From 20592eaa1e31b7ce7d1d09893a95e7bcd320c217 Mon Sep 17 00:00:00 2001 From: PikachuEXE Date: Mon, 10 Jul 2023 14:24:45 +0800 Subject: [PATCH 1/4] * Update recommended video section to use hide videos from channel preference --- .../ft-list-video-lazy/ft-list-video-lazy.js | 19 ++++++++++++++++++- .../watch-video-recommendations.vue | 1 + 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/renderer/components/ft-list-video-lazy/ft-list-video-lazy.js b/src/renderer/components/ft-list-video-lazy/ft-list-video-lazy.js index 2ac01ba81357a..c255110b4b3a8 100644 --- a/src/renderer/components/ft-list-video-lazy/ft-list-video-lazy.js +++ b/src/renderer/components/ft-list-video-lazy/ft-list-video-lazy.js @@ -43,18 +43,35 @@ export default defineComponent({ type: Boolean, default: false, }, + useChannelsHiddenPreference: { + type: Boolean, + default: false, + }, }, data: function () { return { visible: false } }, + computed: { + channelsHidden() { + // Some component users like channel view will have this disabled + if (!this.useChannelsHiddenPreference) { return [] } + + return JSON.parse(this.$store.getters.getChannelsHidden) + }, + + shouldBeVisible() { + return !(this.channelsHidden.includes(this.data.authorId) || + this.channelsHidden.includes(this.data.author)) + } + }, created() { this.visible = this.initialVisibleState }, methods: { onVisibilityChanged: function (visible) { - if (visible) { + if (visible && this.shouldBeVisible) { this.visible = visible } } diff --git a/src/renderer/components/watch-video-recommendations/watch-video-recommendations.vue b/src/renderer/components/watch-video-recommendations/watch-video-recommendations.vue index a8b8dd87b6561..7bd4cf0d7bc96 100644 --- a/src/renderer/components/watch-video-recommendations/watch-video-recommendations.vue +++ b/src/renderer/components/watch-video-recommendations/watch-video-recommendations.vue @@ -22,6 +22,7 @@ :data="video" appearance="recommendation" force-list-type="list" + :use-channels-hidden-preference="true" /> From b9bb0296290cece718c5bd136da533bb8d5c6680 Mon Sep 17 00:00:00 2001 From: PikachuEXE Date: Tue, 11 Jul 2023 11:17:22 +0800 Subject: [PATCH 2/4] * Update setting tooltip text --- static/locales/en-US.yaml | 2 +- static/locales/en_GB.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/static/locales/en-US.yaml b/static/locales/en-US.yaml index 33f7bc84d2db9..b705e79c0e2d3 100644 --- a/static/locales/en-US.yaml +++ b/static/locales/en-US.yaml @@ -829,7 +829,7 @@ Tooltips: you want to be passed to the external player. DefaultCustomArgumentsTemplate: "(Default: '{defaultCustomArguments}')" Distraction Free Settings: - Hide Channels: Enter a channel name or channel ID to hide all videos, playlists and the channel itself from appearing in search or trending. + Hide Channels: Enter a channel name or channel ID to hide all videos, playlists and the channel itself from appearing in search, trending or recommended. The channel name entered must be a complete match and is case sensitive. Subscription Settings: Fetch Feeds from RSS: When enabled, FreeTube will use RSS instead of its default diff --git a/static/locales/en_GB.yaml b/static/locales/en_GB.yaml index fde53b8863cd5..d31225f7abd38 100644 --- a/static/locales/en_GB.yaml +++ b/static/locales/en_GB.yaml @@ -918,7 +918,7 @@ Tooltips: in-memory image cache. Will lead to increased RAM usage. Distraction Free Settings: Hide Channels: Enter a channel name or channel ID to hide all videos, playlists - and the channel itself from appearing in search or trending. The channel name + and the channel itself from appearing in search, trending or recommended. The channel name entered must be a complete match and is case sensitive. Playing Next Video Interval: Playing next video in no time. Click to cancel. | Playing next video in {nextVideoInterval} second. Click to cancel. | Playing next video From b5c092733564db5d7a7ac0d5e2ee4325ca865084 Mon Sep 17 00:00:00 2001 From: PikachuEXE Date: Tue, 11 Jul 2023 15:40:11 +0800 Subject: [PATCH 3/4] Update `or` to `and` --- static/locales/en-US.yaml | 2 +- static/locales/en_GB.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/static/locales/en-US.yaml b/static/locales/en-US.yaml index b705e79c0e2d3..f25adead89f6f 100644 --- a/static/locales/en-US.yaml +++ b/static/locales/en-US.yaml @@ -829,7 +829,7 @@ Tooltips: you want to be passed to the external player. DefaultCustomArgumentsTemplate: "(Default: '{defaultCustomArguments}')" Distraction Free Settings: - Hide Channels: Enter a channel name or channel ID to hide all videos, playlists and the channel itself from appearing in search, trending or recommended. + Hide Channels: Enter a channel name or channel ID to hide all videos, playlists and the channel itself from appearing in search, trending and recommended. The channel name entered must be a complete match and is case sensitive. Subscription Settings: Fetch Feeds from RSS: When enabled, FreeTube will use RSS instead of its default diff --git a/static/locales/en_GB.yaml b/static/locales/en_GB.yaml index d31225f7abd38..b24e766597eaa 100644 --- a/static/locales/en_GB.yaml +++ b/static/locales/en_GB.yaml @@ -918,7 +918,7 @@ Tooltips: in-memory image cache. Will lead to increased RAM usage. Distraction Free Settings: Hide Channels: Enter a channel name or channel ID to hide all videos, playlists - and the channel itself from appearing in search, trending or recommended. The channel name + and the channel itself from appearing in search, trending and recommended. The channel name entered must be a complete match and is case sensitive. Playing Next Video Interval: Playing next video in no time. Click to cancel. | Playing next video in {nextVideoInterval} second. Click to cancel. | Playing next video From 980821f34904f8f186ac13d1298913b3dd9153d4 Mon Sep 17 00:00:00 2001 From: PikachuEXE Date: Tue, 11 Jul 2023 15:50:43 +0800 Subject: [PATCH 4/4] * Update most popular view to use hide videos from channel preference --- .../components/ft-list-lazy-wrapper/ft-list-lazy-wrapper.js | 2 +- static/locales/en-US.yaml | 2 +- static/locales/en_GB.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/renderer/components/ft-list-lazy-wrapper/ft-list-lazy-wrapper.js b/src/renderer/components/ft-list-lazy-wrapper/ft-list-lazy-wrapper.js index 392f208b72680..fd35850be4b66 100644 --- a/src/renderer/components/ft-list-lazy-wrapper/ft-list-lazy-wrapper.js +++ b/src/renderer/components/ft-list-lazy-wrapper/ft-list-lazy-wrapper.js @@ -59,7 +59,7 @@ export default defineComponent({ if (!data.type) { return false } - if (data.type === 'video') { + if (data.type === 'video' || data.type === 'shortVideo') { if (this.hideLiveStreams && (data.liveNow || data.lengthSeconds == null)) { // hide livestreams return false diff --git a/static/locales/en-US.yaml b/static/locales/en-US.yaml index f25adead89f6f..4336e38839978 100644 --- a/static/locales/en-US.yaml +++ b/static/locales/en-US.yaml @@ -829,7 +829,7 @@ Tooltips: you want to be passed to the external player. DefaultCustomArgumentsTemplate: "(Default: '{defaultCustomArguments}')" Distraction Free Settings: - Hide Channels: Enter a channel name or channel ID to hide all videos, playlists and the channel itself from appearing in search, trending and recommended. + Hide Channels: Enter a channel name or channel ID to hide all videos, playlists and the channel itself from appearing in search, trending, most popular and recommended. The channel name entered must be a complete match and is case sensitive. Subscription Settings: Fetch Feeds from RSS: When enabled, FreeTube will use RSS instead of its default diff --git a/static/locales/en_GB.yaml b/static/locales/en_GB.yaml index b24e766597eaa..da691b8fe4e2d 100644 --- a/static/locales/en_GB.yaml +++ b/static/locales/en_GB.yaml @@ -918,7 +918,7 @@ Tooltips: in-memory image cache. Will lead to increased RAM usage. Distraction Free Settings: Hide Channels: Enter a channel name or channel ID to hide all videos, playlists - and the channel itself from appearing in search, trending and recommended. The channel name + and the channel itself from appearing in search, trending, most popular and recommended. The channel name entered must be a complete match and is case sensitive. Playing Next Video Interval: Playing next video in no time. Click to cancel. | Playing next video in {nextVideoInterval} second. Click to cancel. | Playing next video