Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update recommended video section to use hide videos from channel preference #3749

Merged
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
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