-
Notifications
You must be signed in to change notification settings - Fork 887
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 channel page ID handling #2457
Conversation
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.
Do we have a place to stored these "magic values"?
I certainly won't be able to parse all the constant values for idType
in the future.
Not to mention I can't parse them now.
Edit 1: Something like this?
@PikachuEXE As those "magic values" come from yt-channel-info, if we create an enum it should definitely be in yt-channel-info and then imported into FreeTube. https://github.com/FreeTubeApp/yt-channel-info/blob/development/app/helper.js#L501 |
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 locally
All 3 provided URLs returned different channels
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.
Works well, also tested to make sure subpaths worked (ie c/name/playlsts)
Fix channel page ID handling
Pull Request Type
Related issue
closes #2420
fixes a race condition introduced by #2259
Description
This pull request resolves two issues relating to the handling of channel IDs on the channel page.
/channel/
,/user/
and/c/
channel URLs differently, as a/user/
and/c/
URLs with the same id might point to different channels.id
property with the actual channel ID, so if you entered this URLhttps://www.youtube.com/c/linustechtips
, theid
property is set tolinustechtips
and when the info request returns it overwrites it with the channel IDUCXuqSBlHAE6Xw-yeJA0Tunw
, as the videos and playlists functions still expect theid
to belinustechtips
they abort.The fix for this was to introduce an
originalId
property that is only updated when the actual channel changes, which is then used for the abort checks.Testing (for code that is not small enough to be easily understandable)
I tested the following URLs:
Desktop (please complete the following information):