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

Fix Hide Channels and Hide Premier settings #3673

Merged
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 @@ -67,6 +67,10 @@ export default defineComponent({
if (this.hideUpcomingPremieres &&
// Observed for premieres in Local API Channels.
(data.premiereDate != null ||
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Invidious API is mentioned might as well
https://docs.invidious.io/api/common_types/#videoobject

Suggested change
(data.premiereDate != null ||
(data.premiereDate != null ||
// Invidious API
// `premiereTimestamp` only available on premiered videos
// https://docs.invidious.io/api/common_types/#videoobject
data.premiereTimestamp != null ||

// Invidious API
// `premiereTimestamp` only available on premiered videos
// https://docs.invidious.io/api/common_types/#videoobject
data.premiereTimestamp != null ||
// viewCount is our only method of detecting premieres in RSS
// data without sending an additional request.
// If we ever get a better flag, use it here instead.
Expand All @@ -79,12 +83,30 @@ export default defineComponent({
return false
}
} else if (data.type === 'channel') {
if (this.channelsHidden.includes(data.channelID) || this.channelsHidden.includes(data.name)) {
const attrsToCheck = [
// Local API
data.id,
data.name,
// Invidious API
// https://docs.invidious.io/api/common_types/#channelobject
data.author,
data.authorId,
]
if (attrsToCheck.some(a => a != null && this.channelsHidden.includes(a))) {
// hide channels by author
return false
}
} else if (data.type === 'playlist') {
if (this.channelsHidden.includes(data.authorId) || this.channelsHidden.includes(data.author)) {
const attrsToCheck = [
// Local API
data.channelId,
data.channelName,
// Invidious API
// https://docs.invidious.io/api/common_types/#playlistobject
data.author,
data.authorId,
]
if (attrsToCheck.some(a => a != null && this.channelsHidden.includes(a))) {
// hide playlists by author
return false
}
Expand Down
7 changes: 6 additions & 1 deletion src/renderer/views/Subscriptions/Subscriptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,12 @@ export default defineComponent({
return item.viewCount !== '0'
}
// Observed for premieres in Local API Subscriptions.
return item.premiereDate == null
return (item.premiereDate == null ||
// Invidious API
// `premiereTimestamp` only available on premiered videos
// https://docs.invidious.io/api/common_types/#videoobject
item.premiereTimestamp == null
)
})
}

Expand Down