Implement storage download export flow and update database schema#990
Implement storage download export flow and update database schema#990agupta07505 wants to merge 25 commits into
Conversation
…sting Media3 offline playback path.
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
bb69dd8 to
c500b3b
Compare
|
still isn’t ready to merge. The most critical issue is that the exporter can use player-cache spans and only checks for gaps, not whether the final size matches the completed download, so an incomplete file could be exported as valid. The SAF flow also deletes the previous export before the replacement is fully written, while metadata-writing failures are treated as success, which risks data loss or silently broken/untagged files. Removing a download currently deletes the user’s exported copy too, which should only happen if that behavior is clearly intended. Changing the selected folder also doesn’t migrate existing exports because an old internal export is still counted as already exported. Please make replacement atomic, validate the final file length, preserve exported files by default, re-export existing downloads after changing folders. |
|
I have fixed the issues try to verify it... |
510a077 to
7fd4732
Compare
…dd default parameter value
Pull Request
Summary
This pull request introduces the ability for users to select a custom local folder to export downloaded songs using Android's Storage Access Framework (SAF). When a download completes, the
DownloadedSongExporterautomatically retrieves metadata from the local database, retrieves high-resolution artwork via Coil, packages the cached audio spans, embeds appropriate metadata tags (ID3/MP4 Atoms) directly in the file, and scans the file using Android's Media Scanner. The change adds custom location preferences to the Storage settings UI and upgrades the internal database schema to version 31.Linked Work
Change Type
Affected Surfaces
:app:core:lyrics:lastfm:canvas:shazamkit:spotifycoreScreenshots / Recordings
Behavior Notes
Download.STATE_COMPLETED.mp3/aac) and recursively parses/adjusts MP4 chunk offsets (stco/co64atoms) form4acontainers to ensure files remain playable after embedding metadata and artwork.Architecture Checklist
Loading,Success,Empty, andErrorwhere this PR introduces or changes screen state.runBlockingis introduced in app execution paths.Compose / Material Checklist
collectAsStateWithLifecycle().@Immutableor@Stable.keyvalues and explicitcontentType.derivedStateOfwhere appropriate.stringResource()and duplicated visible strings on the same screen are avoided.WindowInsetscorrectly when this PR changes screen layout.Concurrency / Performance Checklist
viewModelScopeor an existing lifecycle-owned application/service scope.Dispatchers.IOorDispatchers.Default.Data / Persistence Checklist
app/schemas.Playback / Integration Checklist
universal,arm64,armeabi,x86, andx86_64variants.Localization / Assets Checklist
Privacy / Security Checklist
Verification
Reviewer Focus
adjustMp4ChunkOffsets,adjustStcoAtom,adjustCo64Atom) insideDownloadedSongExporter.ktto ensure binary data alteration preserves file structure.takePersistableUriPermissionand lifecycle permission releases withinStorageSettings.ktto avoid permission leaks.Release Notes