Skip to content

feat(downloads): add format picker and custom download path#2871

Open
alltechdev wants to merge 5 commits intomainfrom
feat/downloads_path-format
Open

feat(downloads): add format picker and custom download path#2871
alltechdev wants to merge 5 commits intomainfrom
feat/downloads_path-format

Conversation

@alltechdev
Copy link
Collaborator

@alltechdev alltechdev commented Feb 15, 2026

Summary

New Features

  • Add format picker dialog when downloading (shows bitrate/codec options)
  • Add custom download path support via SAF (Storage Access Framework)
  • Export downloads to user-selected folder with Artist/Title structure
  • Integrate Bento4 native library for M4A metadata embedding (cover art, title, artist, album, year)
  • Add "swap download" option to re-download with different quality
  • Show metadata badge on formats that support embedding (M4A 128kbps+)

Bug Fixes

  • Use downloadUri directly for playback to prevent format mismatch errors
  • Check targetItag before cache to respect user format selection
  • Fix URL cache expiry check (wrong comparison operator)
  • Reorder ExtractorsFactory: FragmentedMp4Extractor first for M4A files
  • Disable LTO for coverart native lib to fix CI linker issues

Technical

  • Add database schema migration for downloadUri tracking
  • Only embed metadata for M4A files >= 128kbps (low bitrate compatibility)

Test plan

  • Select custom download folder via Settings → Storage
  • Download a song and choose format (M4A or WebM)
  • Verify downloaded file has embedded metadata (M4A 128kbps+)
  • Test "swap download" to change quality
  • Verify playback uses downloaded file directly
  • Verify no format mismatch errors in logs
Screenshot_20260215-183858_com metrolist music debug Screenshot_20260215-183909_com metrolist music debug Screenshot_20260215-183924_com metrolist music debug Screenshot_20260215-183943_com metrolist music debug Screenshot_20260215-183957_com mixplorer

@alltechdev alltechdev changed the title fix(downloads): resolve format mismatch errors and improve playback feat(downloads): add format picker and custom download path Feb 15, 2026
- Add format picker dialog when downloading songs (shows bitrate/codec)
- Add custom download path support via SAF (Storage Access Framework)
- Export downloads to user-selected folder with Artist/Title structure
- Integrate Bento4 native library for M4A metadata embedding (cover art, title, artist, album, year)
- Add "swap download" option to re-download with different quality
- Add database schema migration for downloadUri tracking
- Only embed metadata for M4A files >= 128kbps (low bitrate compatibility)
- Show metadata badge on format options that support embedding
- Use downloadUri directly for playback instead of ExoPlayer downloadCache
  to prevent format mismatch errors (MatroskaExtractor parsing M4A data)
- Check targetItag before cache in DownloadUtil to respect user format selection
- Clear playerCache when specific format requested to ensure fresh fetch
- Fix URL cache expiry check (was using wrong comparison operator)
- Reorder ExtractorsFactory: FragmentedMp4Extractor first for M4A files
- Add detailed logging for download and cache resolution debugging
@alltechdev alltechdev force-pushed the feat/downloads_path-format branch from cc6fadd to bac1c87 Compare February 16, 2026 01:25
@alltechdev
Copy link
Collaborator Author

alltechdev commented Feb 16, 2026

Just saying, guys, feel free to completely ignore this one 😁 I'm aware it's a ridiculous amount of code, I just really like the functionality, especially bento4.

@Zareeff
Copy link

Zareeff commented Feb 16, 2026

Just saying, guys, feel free to completely ignore this one 😁 I'm aware it's a ridiculous amount of code, I just really like the functionality, especially bento4.

Can you PLEASE tell me how long it took you to write almost 80k lines of code. I bet it was like hell to debug bugs.

@mostafaalagamy
Copy link
Member

I need to review 80,000 lines!!! 🤣

- Move Bento4 library and JNI wrapper to metrolist-coverart-lib repository
- Replace embedded code with git submodule reference
- This reduces main repository size by ~77,000 lines
- Library can now be independently versioned and updated

Submodule: https://github.com/MetrolistGroup/metrolist-coverart-lib
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.

3 participants