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

Refactor existing callbacks into interface #1575

Conversation

DavidFair
Copy link
Contributor

@DavidFair DavidFair commented Mar 27, 2022

Builds on #1574

Changes
Many call-backs already exist between the VideoManager and
PlaybackController. But they are created on an ad-hoc basis in various
methods.

By extracting these out to a method it means we can:

  • Remove the boilerplate of @OverRide methods in PlaybackController
  • Easily refactor these into a seperate class long-term
  • Add new handlers
  • Pass parameters around in the future
  • Not have everything dispatch to a simple onEvent.

This also makes extending the interface easier where we have exoplayer
only notifications (such as onPlaybackSpeedChanged). Since the VLC code
can simply call the notifier without going through a PlaybackListener

--

I'm not super happy with PlaybackControllerNotifiable so I'm open to any/all suggestions on this front, maybe something along the lines of VideoManagerSignals (coming from a Qt background)

@jellyfin-bot jellyfin-bot added the merge conflict Conflicts prevent merging label Mar 29, 2022
@mueslimak3r mueslimak3r added the blocked Needs another PR first label Apr 2, 2022
@DavidFair DavidFair force-pushed the Introduce_interface_notifiable_playback_controller branch from 97127f6 to dfa9f8b Compare April 4, 2022 21:44
@jellyfin-bot jellyfin-bot removed the merge conflict Conflicts prevent merging label Apr 4, 2022
@DavidFair
Copy link
Contributor Author

I've taken the copy from master and extract it into the method as-is, hopefully that unblocks this PR

@mueslimak3r
Copy link
Member

I've taken the copy from master and extract it into the method as-is, hopefully that unblocks this PR

I'm not sure what you mean, are you talking about the latest commit (dfa9f8b)? Blocked just means "this needs another PR first", which in this case is #1574. Both because you explicitly say so and because this PR shares changes with it. The label just helps us keep track of it so they get reviewed and merged in the intended order. So this will get unblocked when the other PR is merged

Copy link
Member

@mueslimak3r mueslimak3r left a comment

Choose a reason for hiding this comment

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

I'll try to do a functional test of this later today

@nielsvanvelzen nielsvanvelzen removed the blocked Needs another PR first label Apr 5, 2022
@jellyfin-bot jellyfin-bot added the merge conflict Conflicts prevent merging label Apr 5, 2022
Many call-backs already exist between the VideoManager and
PlaybackController. But they are created on an ad-hoc basis in various
methods.

By extracting these out to a method it means we can:
- Remove the boilerplate of @OverRide methods in PlaybackController
- Easily refactor these into a seperate class long-term
- Add new handlers
- Pass parameters around in the future
- Not have everything dispatch to a simple onEvent.

This also makes extending the interface easier where we have exoplayer
only notifications (such as onPlaybackSpeedChanged). Since the VLC code
can simply call the notifier without going through a PlaybackListener
@DavidFair DavidFair force-pushed the Introduce_interface_notifiable_playback_controller branch from dfa9f8b to d6866c3 Compare April 6, 2022 21:24
@jellyfin-bot jellyfin-bot removed the merge conflict Conflicts prevent merging label Apr 6, 2022
Annotate the parameters as @nonnull for our new subscribe method, and
init which is just adjacent too
Copy link
Member

@mueslimak3r mueslimak3r left a comment

Choose a reason for hiding this comment

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

I tested movies/series playback, live tv playback, and checked for leaks. Looks good!

@nielsvanvelzen nielsvanvelzen merged commit 67bd4db into jellyfin:master Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants