Skip to content

Commit

Permalink
Update recommended video section to use hide videos from channel pref…
Browse files Browse the repository at this point in the history
…erence (#3749)

* * Update recommended video section to use hide videos from channel preference

* * Update setting tooltip text

* Update `or` to `and`

* * Update most popular view to use hide videos from channel preference
  • Loading branch information
PikachuEXE authored Jul 13, 2023
1 parent 930184d commit 325b36e
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 18 additions & 1 deletion src/renderer/components/ft-list-video-lazy/ft-list-video-lazy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
:data="video"
appearance="recommendation"
force-list-type="list"
:use-channels-hidden-preference="true"
/>
</ft-card>
</template>
Expand Down
2 changes: 1 addition & 1 deletion static/locales/en-US.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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, 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
Expand Down
2 changes: 1 addition & 1 deletion static/locales/en_GB.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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, 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
Expand Down

0 comments on commit 325b36e

Please sign in to comment.