frontend: replace Auth with YoutubeApiWrappers for YouTube callers#13482
frontend: replace Auth with YoutubeApiWrappers for YouTube callers#13482xakep8 wants to merge 3 commits into
Conversation
|
@Warchamp7 PTAL |
e692a50 to
208e16d
Compare
1e3b8a4 to
fe076de
Compare
Warchamp7
left a comment
There was a problem hiding this comment.
There's deeper problems we need to fix here, but this is fine as a small cleanup.
I could raise another PR as a follow up to this and I can clean up other places where the We have a lot of scattered RTTI would it be okay if we centralize it in OBSBasic? Edit: The question was a reference to the code in |
I'm referring more to the architectural problems of YoutubeApiWrappers being an extension of YoutubeAuth which is an extension of OAuthStreamKey which is an extension of OAuth which is an extension of Auth and all kinds of things have been bolted onto all manner of those layers. It's a mess but that's a much larger and complicated problem to fix. |
Got it so considering this, I have a little understanding of what we are dealing with, here's something that I was thinking please let me know if this makes sense as I would like to work on solving this. The YoutubeApiWrapper is inheriting from YoutubeAuth but considering what it does it's not really a more specific Auth object it's more off a Youtube API/broadcast client which needs OAuth data so maybe we should separate it as a YoutubeApiClient which is not a QObject and not a Auth and then we let YoutubeService own this along with a OAuthTokenStore. I also saw that the YoutubeAuth has LoadUI which does the dock creation we can move this out to a YoutubeDockController and also move broadcast setup/start/stop to YoutubeBroadcastController. As a first cleanup, I can first work on the YoutubeApiClient part and then clean up the call sites to use YoutubeApiClient instead of the YoutubeApiWrappers. Please suggest if I'm missing something. |
This comment was marked as outdated.
This comment was marked as outdated.
b7dba96 to
995c3fd
Compare
Created YoutubeApiClient and moved the broadcast and stream related functions from YoutubeApiWrappers to YoutubeApiClient and added apiClient object to YoutubeApiWrappers. This helps move the mixed ownership issue from YoutubeApiWrappers inheriting from YoutubeAuth only because it needs OAuth information, follow up refactor would be to move the broadcast setup/start/stop out to YoutubeBroadcastController and create a YoutubeService class which owns the OAuthTokenStore, YoutubeApiClient, YoutubeBroadcastController and the YoutubeDockController. (cherry picked from commit c4b8cb7)
Description
Part of #13443
Updates YouTube-specific frontend code to pass
YoutubeApiWrappersdirectly where the caller already requires YouTube auth object, instead of passing genericAuth.Motivation and Context
OBSYoutubeActionsand related YouTube-specific paths only work with the YouTube API version of Auth object. Passing genericAuthinto these call sites pushes constructors to performdynamic_castinternally when it should be the callers responsibility.How Has This Been Tested?
Types of changes
Checklist: