Files
Purefin/app
Barnabas Balogh 88e9ca229e refactor: abstract player logic into PlayerManager and MediaRepository
- Introduce `PlayerManager` to encapsulate `Media3` player interactions, state management, and UI updates.
  - Manages playback state (playing, buffering, ended, error), progress, metadata, track selection, and the media queue.
  - Exposes state via `StateFlow` for reactive UI updates.
  - Handles player lifecycle and event listeners.
- Create `MediaRepository` to fetch media items and upcoming episodes from the Jellyfin API.
  - Abstracts away the logic for retrieving media sources, playback URLs, and constructing `MediaItem` objects.
  - Includes a method to get the next episodes for auto-play, avoiding duplicates already in the queue.
- Implement `TrackMapper` to convert Media3 `Tracks` into a `TrackSelectionState` model for the UI.
- Refactor `PlayerViewModel` to delegate all player and data-fetching logic to `PlayerManager` and `MediaRepository`.
  - The ViewModel now observes state flows from the manager and orchestrates UI actions (e.g., auto-hiding controls).
  - Simplifies the ViewModel by removing direct player listener implementation, progress loops, and track parsing.
  - Improves error handling for invalid media IDs and data loading issues.
2026-01-28 21:08:33 +01:00
..
2026-01-16 19:47:33 +01:00
2026-01-16 19:47:33 +01:00