Merge pull request #1218 from macks36/master

Option to minimize recommendations on desktop and by default
This commit is contained in:
Kavin 2022-07-20 20:23:20 +05:30 committed by GitHub
commit 58ce63eca4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 3 deletions

View File

@ -124,6 +124,16 @@
@change="onChange($event)" @change="onChange($event)"
/> />
<br /> <br />
<label for="chkMinimizeRecommendations"><strong v-t="'actions.minimize_recommendations_default'" /></label>
<br />
<input
id="chkMinimizeRecommendations"
v-model="minimizeRecommendations"
class="checkbox"
type="checkbox"
@change="onChange($event)"
/>
<br />
<label for="chkStoreWatchHistory"><strong v-t="'actions.store_watch_history'" /></label> <label for="chkStoreWatchHistory"><strong v-t="'actions.store_watch_history'" /></label>
<br /> <br />
<input <input
@ -250,6 +260,7 @@ export default {
defaultHomepage: "trending", defaultHomepage: "trending",
showComments: true, showComments: true,
minimizeDescription: false, minimizeDescription: false,
minimizeRecommendations: false,
watchHistory: false, watchHistory: false,
selectedLanguage: "en", selectedLanguage: "en",
languages: [ languages: [
@ -380,6 +391,7 @@ export default {
this.defaultHomepage = this.getPreferenceString("homepage", "trending"); this.defaultHomepage = this.getPreferenceString("homepage", "trending");
this.showComments = this.getPreferenceBoolean("comments", true); this.showComments = this.getPreferenceBoolean("comments", true);
this.minimizeDescription = this.getPreferenceBoolean("minimizeDescription", false); this.minimizeDescription = this.getPreferenceBoolean("minimizeDescription", false);
this.minimizeRecommendations = this.getPreferenceBoolean("minimizeRecommendations", false);
this.watchHistory = this.getPreferenceBoolean("watchHistory", false); this.watchHistory = this.getPreferenceBoolean("watchHistory", false);
this.selectedLanguage = this.getPreferenceString("hl", await this.defaultLangage); this.selectedLanguage = this.getPreferenceString("hl", await this.defaultLangage);
this.enabledCodecs = this.getPreferenceString("enabledCodecs", "vp9,avc").split(","); this.enabledCodecs = this.getPreferenceString("enabledCodecs", "vp9,avc").split(",");
@ -434,6 +446,7 @@ export default {
localStorage.setItem("homepage", this.defaultHomepage); localStorage.setItem("homepage", this.defaultHomepage);
localStorage.setItem("comments", this.showComments); localStorage.setItem("comments", this.showComments);
localStorage.setItem("minimizeDescription", this.minimizeDescription); localStorage.setItem("minimizeDescription", this.minimizeDescription);
localStorage.setItem("minimizeRecommendations", this.minimizeRecommendations);
localStorage.setItem("watchHistory", this.watchHistory); localStorage.setItem("watchHistory", this.watchHistory);
localStorage.setItem("hl", this.selectedLanguage); localStorage.setItem("hl", this.selectedLanguage);
localStorage.setItem("enabledCodecs", this.enabledCodecs.join(",")); localStorage.setItem("enabledCodecs", this.enabledCodecs.join(","));

View File

@ -182,12 +182,12 @@
:selected-index="index" :selected-index="index"
/> />
<a <a
class="btn mb-2 sm:hidden" class="btn mb-2"
@click="showRecs = !showRecs" @click="showRecs = !showRecs"
v-t="`actions.${showRecs ? 'minimize_recommendations' : 'show_recommendations'}`" v-t="`actions.${showRecs ? 'minimize_recommendations' : 'show_recommendations'}`"
/> />
<hr v-show="showRecs" /> <hr v-show="showRecs" />
<div v-show="showRecs || !smallView"> <div v-show="showRecs">
<VideoItem <VideoItem
v-for="related in video.relatedStreams" v-for="related in video.relatedStreams"
:key="related.url" :key="related.url"
@ -322,6 +322,7 @@ export default {
this.active = true; this.active = true;
this.selectedAutoPlay = this.getPreferenceBoolean("autoplay", false); this.selectedAutoPlay = this.getPreferenceBoolean("autoplay", false);
this.showDesc = !this.getPreferenceBoolean("minimizeDescription", false); this.showDesc = !this.getPreferenceBoolean("minimizeDescription", false);
this.showRecs = !this.getPreferenceBoolean("minimizeRecommendations", false);
if (this.video.duration) { if (this.video.duration) {
document.title = this.video.title + " - Piped"; document.title = this.video.title + " - Piped";
this.$refs.videoPlayer.loadVideo(); this.$refs.videoPlayer.loadVideo();

View File

@ -82,7 +82,8 @@
"delete_playlist_confirm": "Are you sure you want to delete this playlist?", "delete_playlist_confirm": "Are you sure you want to delete this playlist?",
"please_select_playlist": "Please select a playlist", "please_select_playlist": "Please select a playlist",
"delete_account": "Delete Account", "delete_account": "Delete Account",
"logout": "Logout" "logout": "Logout",
"minimize_recommendations_default": "Minimize Recommendations by default"
}, },
"comment": { "comment": {
"pinned_by": "Pinned by" "pinned_by": "Pinned by"