Fix playback restart, default dir, scanning permissions, and cover art#3
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Fix playback restart, default dir, scanning permissions, and cover art#3devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the 4 reported issues before the 1.6.9 release. This branch is built on top of #2, so its diff into
mainalso includes the Gradle build fix from #2 — merging this PR alone delivers everything (you can then close #2). If you merge #2 first, this PR's diff shrinks to just the app changes below.1. Track doesn't play after app restart
_initialize()restored the saved playlist before attaching an audio source to the player, leaving the player without a usable source after restart. Reordered so the (empty)ConcatenatingAudioSourceis attached first, then the playlist is restored:addFilesgained anautoPlayflag so restoring on launch doesn't start playback unexpectedly.2. Move default directory to
Download/EclipseMusic_defaultScanRoot()(Android) now returns/storage/emulated/0/Download/EclipseMusicinstead of/storage/emulated/0/EclipseMusic; the UI default-path string was updated to match.3. Scanning didn't work (default or custom root)
Root cause: no runtime storage permission, and
file_selectorreturns a Storage Access Framework tree URI on Android that the raw-path scanner can't read.permission_handler;scanAndAddRoot()now calls_ensureStoragePermission()(requestsREAD_MEDIA_AUDIO/MANAGE_EXTERNAL_STORAGE) before scanning and exposeslastScanPermissionDeniedso the UI shows a clear message._normalizeAndroidDirPath()convertingcontent://.../tree/primary:Music/Sub→/storage/emulated/0/Music/Subfor the picked custom folder.READ_MEDIA_AUDIO,READ_EXTERNAL_STORAGE(maxSdk 32) andMANAGE_EXTERNAL_STORAGEinAndroidManifest.xml.4. Show embedded cover art in thumbnails
Added a pure-Dart ID3 reader (
lib/utils/metadata.dart) — no native dependency, to keep CI deterministic — that parses ID3v2 (incl. binaryAPICframes) with an ID3v1 fallback. Extracted artwork is cached to a temp dir;_buildMetadata()stores itsartPath, and the list tiles + player thumbnail render it via_trackArt()(falling back to the music-note icon when absent or unreadable).Verification
flutter build apk --release→✓ Built app-release.apk (52.3MB).flutter analyze lib/→ no errors/warnings (info-level lints only).test/metadata_test.dart;flutter test test/metadata_test.dart→All tests passed!(validates ID3v2 title/artist/album + APIC art extraction, and empty-tag fallback).Link to Devin session: https://app.devin.ai/sessions/397387253e524159baa36ad526240957
Requested by: @BlazeTrack