-
-
Notifications
You must be signed in to change notification settings - Fork 446
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
Migrate Twitch badges to Helix #4537
Migrate Twitch badges to Helix #4537
Conversation
Did you forget to commit |
Co-authored-by: iProdigy <[email protected]>
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.
nit: can remove Content-Type
header as there is no request body
Be sure to define virtual functions in |
That's right, I was missing the definition of virtual variables in |
Co-authored-by: iProdigy <[email protected]>
Checking this PR from the artifact loads all badges as expected |
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.
Looks good so far!
The two remaining steps I see are:
- Modify the
TwitchBadges.cpp
functionloadTwitchBadges
to instead use the method you createdgetGlobalBadges()
- Modify the
TwitchChannel.cpp
functionrefreshBadges
to instead use the method you createdgetChannelBadges(broadcasterID)
After that's done, the PR is ready for testing! 🧇
https://twitter.com/TwitchDev/status/1647017279123513344 Looks like the endpoint has been updated with some more info, not sure if anything in this PR needs to change. Perhaps the new info should parsed into our badge structs? Unclear if we would even use it. |
I believe that at the time of starting this PR those data were already available since they were released together with the official announcement. I guess it was only now that it was made public on Twitter 🤔 |
This is correct, @iProdigy confirmed all the data available from the legacy endpoint was also available in the Helix response the day after the deprecation announcement. |
…nianMidian/chatterino2 into helix-migration/twitch-badges
…nianMidian/chatterino2 into helix-migration/twitch-badges
} | ||
break; | ||
} | ||
qCWarning(chatterinoTwitch) << errorMessage; | ||
QFile file(":/twitch-badges.json"); |
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.
In a follow-up PR, we can convert twitch-badges.json
to use the new helix structure (this would allow enable a refactor of parseTwitchBadges
that leverages the new structs from this PR).
This prevents the parameter from being copied for each invocation - since we know the lifetime of the object this is not a problem
There's not really a big gain in any particular way, but it makes it, imo, more readable since it's less code
We don't use the default constructor, so we don't need it defined Bonus: This also adds a newline between the member variables & the constructor
The Helix API calls it data, but for us it makes more sense to call it `badgeSets`
also include identifiers in the message itself to make it more identifiable
get is already the default request type if one is not specified (see NetworkRequest.hpp)
This is done by capturing a weak pointer of the channel into the success & failure lambdas, then verifying that we're able to lock them when the request has finished
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.
Thank you! As a first-time contributor, you can now add yourself to the contributors list that's shown inside the About page in Chatterino.
If you want this, you can open a new PR where you modify the resources/contributors.txt
file and add yourself to the list. Make sure to read the comments at the top for instructions.
Pull request checklist:
Closes #4492
CHANGELOG.md
was updated, if applicableDescription
The legacy badges endpoint will be closed for the first time on May 4 and permanently on June 1, so it is necessary to migrate this endpoint to the Helix API.
Official announcement: https://discuss.dev.twitch.tv/t/legacy-badges-endpoint-shutdown-details-and-timeline-june-2023/44621