Skip to content

fix: play downloaded tracks offline via MediaStore fallback - #38

Closed
Centurion-Rome wants to merge 2 commits into
Clash-Projects:mainfrom
Centurion-Rome:fix/37-offline-playback
Closed

fix: play downloaded tracks offline via MediaStore fallback#38
Centurion-Rome wants to merge 2 commits into
Clash-Projects:mainfrom
Centurion-Rome:fix/37-offline-playback

Conversation

@Centurion-Rome

Copy link
Copy Markdown

Fixes #37.

Offline playback of already-downloaded files in Music/LastWave failed whenever the Room download record was missing (reinstall, cleared data) or stale, and on Android 13+ the app could not see those files at all:

  • MusicPlayer now resolves Room first, then probes Music/LastWave through MediaStore.Audio ('artist - title'.ext) and plays the resulting content:// URI, keeping the legacy File probe as a last resort before remote streaming.
  • Adds READ_MEDIA_AUDIO (Android 13+) to the manifest and requests it at startup; without it orphaned downloads are invisible to both File and MediaStore lookups (verified on Pixel 7 Pro).
  • Extracts the pure offline-resolution decision table into OfflinePlaybackResolver (no Android deps, JVM-testable); downloader naming/key helpers shared via TrackDownloadManager.

Tested: fresh install on Pixel 7 Pro, granted audio permission, played an offline FLAC from Music/LastWave with network off.

Resolve local downloads from Room first, then probe Music/LastWave
through MediaStore.Audio (content:// URI) before falling back to
remote streaming, so orphaned files still play after reinstall or
cleared data. Adds READ_MEDIA_AUDIO (Android 13+) to the manifest
and requests it at startup; extracts the pure resolution logic into
OfflinePlaybackResolver.
@ajisth69 ajisth69 closed this Sep 8, 2026
@Centurion-Rome

Copy link
Copy Markdown
Author

@ajisth69 why not merged, any reason?

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.

[Bug]: Offline playback does not use downloaded local files

2 participants