-
Notifications
You must be signed in to change notification settings - Fork 877
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
Fix Hide Channels and Hide Premier settings #3673
Conversation
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
There is another
|
Head branch was pushed to by a user without write access
have updated :) |
I am using https://www.youtube.com/channel/UCUKPG1-r4WFyxpyhIuCs86Q for testing premiere |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested https://youtube.com/channel/UC1BWMtZbNLVMSFgwSukjqCw on yarn dev:web
Tested hide channels option (Using Linux Tech Tips
)
Tested with hide premiere (Local API, RSS on & off)
Hi @petaded thanks for opening this PR. If i search Linus Tech Tips and apply the playlist filter i get playlists created by LTT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filter out playlists
Head branch was pushed to by a user without write access
65932b4
e9b039c
if (this.hideUpcomingPremieres && | ||
// Observed for premieres in Local API Channels. | ||
(data.durationText === 'PREMIERE' || | ||
(data.premiereDate != null || |
There was a problem hiding this comment.
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
(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 || |
if (this.channelsHidden.includes(data.id) || this.channelsHidden.includes(data.name) || | ||
this.channelsHidden.includes(data.authorId) || this.channelsHidden.includes(data.author)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better doc
if (this.channelsHidden.includes(data.id) || this.channelsHidden.includes(data.name) || | |
this.channelsHidden.includes(data.authorId) || this.channelsHidden.includes(data.author)) { | |
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))) { | |
if (this.channelsHidden.includes(data.channelId) || this.channelsHidden.includes(data.channelName) || | ||
this.channelsHidden.includes(data.authorId) || this.channelsHidden.includes(data.author)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better doc
if (this.channelsHidden.includes(data.channelId) || this.channelsHidden.includes(data.channelName) || | |
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))) { | |
Test results after latest commit IV fix commit:
|
Which is why I request change :) |
…er channel (#3668) * Changes from PR #3673 * * Update subscription view to be able to load videos from video cache again * * Update subscription view to be able to load videos from video cache per channel * * Remove meaningless argument `allowUseOfChannelCache` * $ Remove unused imports --------- Co-authored-by: petaded <[email protected]>
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
That would be helpful thank you. I currently don't have access to any computer I can develop on atm. I have seen your recent replies about updates to the PR but same as above, until I have somewhere I can make changes I'm stuck. |
Squashed commits: [65932b4] update playlist and channel filtering [952a721] update subscriptions js to use premiereDate over durationText [530dea9] Add back isRSS and viewcount check to fix when in subscriptions page [93ebb76] Fix hide premiere [de7a8b4] ft-list-lazy-wrapper put whitespace back to what it was [8dadb59] move showResult from a method to a computed to work with v-if
e9b039c
to
aa67d05
Compare
Conflicts have been resolved. A maintainer will review the pull request shortly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Created discussion #3744! |
Fix Hide Channels and Hide Premier settings
Pull Request Type
Related issue
PR #3091 broke the hide channels and hide upcoming premiers option.
fixes #3419
Description
This PR fixes the showResult function to actually be run after PR #3091 stopped it working.
Having a
v-if="method"
means that it doesn't actually run the method instead just evaluates it (which always evaluates to true).You can easily test this yourself by adding a console log in showResult and it will currently never be run.
To fix this and keep the wanted fix from 3091. I have changed showResult to a computed property from a method which means it does get run and will be re-evaluated on change (which is what 3091 wanted).
Also this fixes the hide premiere setting which was broken both because of the above issue and because youtube has changed since it was originally implemented. Now instead of checking
durationText === 'PREMIERE'
which it no longer is. We can instead just check thepremiereDate
which if its not null is a premiere video.Note: when you are subscribed to a channel and using RSS premiereDate is not included hence we still need the
data.isRSS && data.viewCount === '0'
check.Screenshots
Testing
Tested that this PR keeps the fix that #3091 wanted by doing the same test as them
yarn dev:web
and going to channel https://youtube.com/channel/UC1BWMtZbNLVMSFgwSukjqCwAlso tested that the hide channels option is working again. by entering "Linus Tech Tips" into it and searching for LTT. Videos and channel are hidden.
No LTT videos are shown now if searching LTT
Testing the hide premiere option.
Testing hide premiere on the subscription page with isRSS enabled.
Desktop
Additional context
Note: the file preview shown by git doesn't seem to show the correct moved section. If you check the real difference you can see I just moved the
showResult
from themethods: {}
to thecomputed: {}
section.