Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/components/NavBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ export default {
return _this.getPreferenceBoolean("watchHistory", false);
},
shouldShowTrending(_this) {
return _this.getPreferenceString("homepage", "trending") != "trending";
return (
_this.getPreferenceString("homepage", "trending") != "trending" &&
_this.getPreferenceBoolean("showTrending", true)
);
},
showSearchHistory(_this) {
return _this.getPreferenceBoolean("searchHistory", false) && localStorage.getItem("search_history");
Expand Down
14 changes: 14 additions & 0 deletions src/components/PreferencesPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@
</select>
</label>

<label class="pref" for="ddlShowTrending">
<strong v-t="'actions.show_trending'" />
<input
id="ddlShowTrending"
v-model="showTrending"
class="checkbox"
type="checkbox"
@change="onChange($event)"
/>
</label>

<h2 v-t="'titles.player'" class="text-center" />
<label class="pref" for="chkAutoPlayVideo">
<strong v-t="'actions.autoplay_video'" />
Expand Down Expand Up @@ -516,6 +527,7 @@ export default {
password: null,
showConfirmResetPrefsDialog: false,
showCustomInstancesModal: false,
showTrending: true,
};
},
computed: {
Expand Down Expand Up @@ -581,6 +593,7 @@ export default {
this.prefetchLimit = this.getPreferenceNumber("prefetchLimit", 2);
this.hideWatched = this.getPreferenceBoolean("hideWatched", false);
this.mobileChapterLayout = this.getPreferenceString("mobileChapterLayout", "Vertical");
this.showTrending = this.getPreferenceBoolean("showTrending", true);
if (this.selectedLanguage != "en") {
try {
this.CountryMap = await import(`../utils/CountryMaps/${this.selectedLanguage}.json`).then(
Expand Down Expand Up @@ -645,6 +658,7 @@ export default {
localStorage.setItem("prefetchLimit", this.prefetchLimit);
localStorage.setItem("hideWatched", this.hideWatched);
localStorage.setItem("mobileChapterLayout", this.mobileChapterLayout);
localStorage.setItem("showTrending", this.showTrending);

if (shouldReload) window.location.reload();
}
Expand Down
3 changes: 2 additions & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@
"export": "Export",
"never": "Never",
"playlists_only": "Playlists only",
"always": "Always"
"always": "Always",
"show_trending": "Show Trending",
},
"comment": {
"pinned_by": "Pinned by {author}",
Expand Down