Open
Conversation
This commit resolves issue #96 by adding playback reporting functionality for remote media servers. The implementation follows the existing architecture patterns and integrates seamlessly with the playback system. Changes: 1. Created PlaybackReportingService for each provider: - Jellyfin: POST /Sessions/Playing, /Playing/Progress, /Playing/Stopped - Emby: Same endpoints as Jellyfin (compatible API) - Plex: GET /:/timeline for state updates, /:/scrobble for completion 2. Added PlaybackInfo data classes for each provider: - Jellyfin/Emby: PlaybackStartInfo, PlaybackProgressInfo, PlaybackStopInfo - Plex: Uses query parameters with PlaybackState enum 3. Updated DI modules to provide PlaybackReportingService instances: - JellyfinMediaProviderModule - EmbyMediaProviderModule - PlexMediaProviderModule 4. Created PlaybackReporter coordinator class: - Implements PlaybackWatcherCallback to listen for playback events - Routes reporting to appropriate service based on Song.mediaProvider - Manages session IDs and progress reporting intervals (10s) - Handles playback start, progress updates, pause/resume, and stop - Only reports for remote providers (not local files) 5. Created PlaybackReporterInitializer: - Registers PlaybackReporter with PlaybackWatcher on app startup - Integrated via AppModuleBinds using Hilt's multibinding Architecture: - Follows Observer pattern (PlaybackWatcherCallback) - Uses Strategy pattern for provider-specific implementations - Dependency injection via Hilt for all components - Coroutine-based async operations - Proper error handling with Timber logging Benefits: - Jellyfin/Emby/Plex servers now receive "now playing" updates - Server dashboards show active playback sessions - Playback history is tracked on the server side - Play counts and progress are synced to servers - No changes required to existing playback logic Fixes #96
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit resolves issue #96 by adding playback reporting functionality for remote media servers. The implementation follows the existing architecture patterns and integrates seamlessly with the playback system.
Changes:
Created PlaybackReportingService for each provider:
Added PlaybackInfo data classes for each provider:
Updated DI modules to provide PlaybackReportingService instances:
Created PlaybackReporter coordinator class:
Created PlaybackReporterInitializer:
Architecture:
Benefits:
Fixes #96