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

Add PlaySessionService to playback rewrite #2428

Merged
merged 1 commit into from
Jan 18, 2023

Conversation

nielsvanvelzen
Copy link
Member

There we go, the second third big PR for the playback rewrite! This one adds play session support which is pretty essential for Jellyfin.

Changes

  • Add JellyfinPlugin
    • Adds all Jellyfin specific stuff like PlaySession, Media resolving, QuickConnect etc.
  • Add PlaySessionService
  • Add PlaySessionSocketService
    • Listens for PlayState commands on the WebSocket connection
    • This is what allows for remote control
    • Currently doesn't support playing queues yet
      • This will come after video support is added and we can determine the queue type etc.
    • Works quite well with jellyfin-web :)

Issues

Part of #1057

@nielsvanvelzen nielsvanvelzen added enhancement New feature or request playback Issue related to media playback labels Jan 17, 2023
@nielsvanvelzen nielsvanvelzen added this to the v0.16.0 milestone Jan 17, 2023
// The queues are lazy loaded so we only load a small amount of items to set as queue on the
// backend.
return manager.queue
?.peekNext(15)

Check warning

Code scanning / detekt

Report magic numbers. Magic number is a numeric literal that is not defined as a constant and hence it's unclear what the purpose of this number is. It's better to declare such numbers as constants and give them a proper name. By default, -1, 0, 1, and 2 are not considered to be magic numbers.

This expression contains a magic number. Consider defining it to a well named constant.
/**
* The value of this duration expressed as a [Long] number of ticks.
*/
private val Duration.inWholeTicks: Long get() = toLong(DurationUnit.NANOSECONDS).div(100L)

Check warning

Code scanning / detekt

Report magic numbers. Magic number is a numeric literal that is not defined as a constant and hence it's unclear what the purpose of this number is. It's better to declare such numbers as constants and give them a proper name. By default, -1, 0, 1, and 2 are not considered to be magic numbers.

This expression contains a magic number. Consider defining it to a well named constant.
/**
* Convert ticks to duration
*/
private val Long.ticks get() = div(100L).nanoseconds

Check warning

Code scanning / detekt

Report magic numbers. Magic number is a numeric literal that is not defined as a constant and hence it's unclear what the purpose of this number is. It's better to declare such numbers as constants and give them a proper name. By default, -1, 0, 1, and 2 are not considered to be magic numbers.

This expression contains a magic number. Consider defining it to a well named constant.
@nielsvanvelzen nielsvanvelzen merged commit 6029289 into jellyfin:master Jan 18, 2023
@nielsvanvelzen nielsvanvelzen deleted the playback-playsession branch January 18, 2023 08:07
@nielsvanvelzen nielsvanvelzen mentioned this pull request Jan 30, 2023
35 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request playback Issue related to media playback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants