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 flow support for elements #4031

Merged

Conversation

nielsvanvelzen
Copy link
Member

Until now all elements were set before they needed to be read. While working on lyrics support this became a limitation. For lyrics we'll fetch them when the song starts playing instead of preloading it. The UI would need to be notified of the lyrics being added, therefor I've added a new API to the ElementsContainer that can return a flow. To avoid caching a bunch of stateflows this implementation uses a single internal flow that emits for each element update, this then prompts the returned flows to update themself.

Unlike the simple getters we do not have a requiredFlow, instead it will always emit either a value or null. I may change this in the future.

Changes

  • Add flow support for elements
    • Add flow getters for all current elements

Issues

Part of #1057

@nielsvanvelzen nielsvanvelzen added the enhancement New feature or request label Sep 28, 2024
@nielsvanvelzen nielsvanvelzen added this to the v0.18.0 milestone Sep 28, 2024
@nielsvanvelzen nielsvanvelzen merged commit d5bb732 into jellyfin:master Sep 28, 2024
5 checks passed
@nielsvanvelzen nielsvanvelzen deleted the playback-element-flow branch September 28, 2024 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants