Skip to content

Add offline cloud playback and MusicBrainz enrichment - #85

Open
lostf1sh wants to merge 3 commits into
mainfrom
feat/navidrome-download-lb-enrichment
Open

Add offline cloud playback and MusicBrainz enrichment#85
lostf1sh wants to merge 3 commits into
mainfrom
feat/navidrome-download-lb-enrichment

Conversation

@lostf1sh

@lostf1sh lostf1sh commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Why

Cloud libraries currently stop being useful as soon as the device loses its connection, and MusicBrainz identifiers can only come from metadata that was already present in a file. This PR makes self-hosted libraries more dependable on the go and gives people an explicit, reviewable way to enrich sparse metadata.

It also removes the Android Auto browsing surface, which is no longer part of the app's intended scope, while keeping ordinary notification, lock-screen, Bluetooth, and system media controls working.

What changed

  • Added offline downloads for Navidrome/Subsonic and Jellyfin tracks.
    • Downloads run through WorkManager with network and storage constraints.
    • Track sheets show queued/downloading progress, retry, and remove actions.
    • Cloud album pages can download or remove the whole album.
    • Completed downloads live in app-private storage, are excluded from Android backup/device transfer, and are preferred automatically during playback.
  • Added on-demand MusicBrainz enrichment.
    • Searches use the track title, artist, album, and duration.
    • The user chooses a result before anything is applied.
    • Recording, release, and artist MBIDs are stored locally.
    • Existing metadata is preserved; only missing years and placeholder names are filled.
    • Requests use an identifying User-Agent and are serialized to respect MusicBrainz's rate limit.
  • Removed Android Auto media-library discovery.
    • Replaced MediaLibraryService with MediaSessionService.
    • Removed browser/library callbacks and manifest discovery entries.
    • Kept standard MediaSession controls for other system surfaces.
  • Added the Room v4 → v5 migration and exported schema for offline download state.
  • Updated the README, changelog, privacy notes, and backup rules.

Validation

  • ./gradlew :app:assembleDebug
  • Targeted unit tests for offline downloads, MusicBrainz parsing/ranking, cloud stream security, and MediaSession workflows
  • git diff --check

The targeted checks pass and the debug APK builds successfully. The project-wide lint task still reports existing errors in unrelated code (including LibraryScreen locale observation and Media3 opt-in warnings in FadingPlayer). The full unit suite also has 12 existing failures in MusicRepositoryImplTest and BackupManagerTest; the tests covering this PR pass.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@lostf1sh
lostf1sh marked this pull request as ready for review August 9, 2026 20:34
@greptile-apps

greptile-apps Bot commented Aug 9, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds app-private offline playback for Navidrome/Subsonic and Jellyfin, introduces user-reviewed MusicBrainz enrichment, and removes Android Auto library browsing while retaining ordinary media controls.

  • Adds WorkManager-backed cloud downloads, download management UI, and local-file playback preference.
  • Adds MusicBrainz search, result ranking, identifier persistence, and conservative metadata enrichment.
  • Adds the Room v4-to-v5 migration, backup exclusions, documentation updates, and MediaSession service changes.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains within the eligible follow-up scope.

No blocking failure remains.

Important Files Changed

Filename Overview
app/src/main/java/com/lostf1sh/pixelplayeross/data/offline/CloudOfflineRepository.kt Coordinates attempt-scoped download enqueue, retry, removal, observation, and local URI resolution; the previously reported cancellation race is addressed with guarded attempt ownership.
app/src/main/java/com/lostf1sh/pixelplayeross/data/worker/CloudTrackDownloadWorker.kt Downloads validated cloud streams into attempt-scoped temporary files and conditionally publishes completed state.
app/src/main/java/com/lostf1sh/pixelplayeross/presentation/viewmodel/SongInfoBottomSheetViewModel.kt Adds MusicBrainz search and apply workflows, with the previously hardcoded fallback messages now resolved from Android string resources.
app/src/main/java/com/lostf1sh/pixelplayeross/data/musicbrainz/MusicBrainzRepository.kt Implements serialized MusicBrainz lookup, ranking, and conservative application of selected metadata.
app/src/main/java/com/lostf1sh/pixelplayeross/data/service/MusicService.kt Replaces media-library browsing behavior with standard MediaSession service integration while preserving playback controls.
app/src/main/java/com/lostf1sh/pixelplayeross/data/database/Migrations.kt Adds the v4-to-v5 database migration supporting attempt-scoped offline download state.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    Cloud[Navidrome / Jellyfin] --> Worker[WorkManager download]
    Worker --> PrivateStorage[App-private offline file]
    PrivateStorage --> Playback[MediaSession playback]
    Track[Track metadata] --> MB[MusicBrainz search]
    MB --> Review[User selects match]
    Review --> Database[Persist MBIDs and missing metadata]
Loading

Reviews (3): Last reviewed commit: "Add cloud download management UI" | Re-trigger Greptile

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.

1 participant