Repository navigation
feat(library): add Audio tab with MediaStore scanning and queue playback - #167
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Deploying mpvium with
|
| Latest commit: |
106a26d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://890e9fb0.mpvium.pages.dev |
| Branch Preview URL: | https://feat-audio-library.mpvium.pages.dev |
Reviewer's GuideData structuresDefine the audio track, album, and artist models and their composite identifiers, which underpin scanning, browsing, and playback.
APIExpose the audio library repository and scanning results as observable state, with refresh and presence-check operations for consumers.
Add audio-mode metadata and playback-action hooks that connect the player and media service to queue navigation.
Provide album and track launchers that pass audio queue URIs, the selected index, and display metadata into PlayerActivity.
Uses of the APIConnect the Audio tab to the repository’s presence state and route canonical tab index 6 to the new screen.
Register Audio as canonical tab 6, default it on, and filter it from visible tabs when no audio is present.
ImplementationScan MediaStore audio rows, build track records, and group them into sorted albums and artists with artwork URIs.
Add audio extension and MIME helpers while keeping audio classification separate from video-file detection.
Initialize audio-mode metadata in PlayerActivity, preserve audio playback across pauses, and wire service notification actions to queue navigation.
Keep standard video controls out of audio mode and render the dedicated audio player surface instead.
UIAdd the Audio browsing screen with album layouts, track and artist views, search, refresh, and navigation into album details.
Add album detail browsing with play-all, shuffle, and track selection actions.
Render reusable album art, album and track cards, and artist rows for audio browsing and playback.
Add the audio playback surface with artwork, seek and transport controls, repeat and shuffle, and a queue sheet.
Add user-facing strings for Audio browsing, playback, queue, empty states, and transport controls.
ConfigurationRequest Android access to MediaStore audio and register the repository in dependency injection.
Persist the Audio tab’s grid/list layout independently from other library layouts.
Add the Audio tab to Appearance navigation options and define the audio-specific layout preference.
Make notification startup and updates tolerate denied notification permission while preserving playback service behavior.
Add the persisted audio layout preference and its default to the browser layout preference tests.
DocumentationDocument the Audio library, browsing layouts, dedicated player, and background playback in the unreleased changelog.
TestsTest audio model identifiers and confirm audio extensions remain separate from video-file classification.
Test canonical Audio tab registration, default visibility, and automatic hiding when no audio is present.
Other changesFiles not grouped.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a562f6a7fa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| MediaPlaybackService.playbackActionListener = object : MediaPlaybackService.PlaybackActionListener { | ||
| override fun onSkipToNext() { runOnUiThread { playNext() } } | ||
| override fun onSkipToPrevious() { runOnUiThread { playPrevious() } } | ||
| } |
There was a problem hiding this comment.
Preserve video notification seek actions
handleFileLoaded() starts this service for every media item, so this listener is also installed during normal video playback. Notification Next/Previous then navigate the video playlist—or do nothing when there is no playlist—instead of preserving the existing ±10-second seek behavior. Restrict queue navigation to audio mode and retain seeking for video.
Useful? React with 👍 / 👎.
| title = fileName, | ||
| artist = viewModel.audioArtist.value, | ||
| album = viewModel.audioAlbum.value, | ||
| artUri = viewModel.audioArtUri.value, |
There was a problem hiding this comment.
Load metadata for the selected queue item
When a queued track is selected after the initial launch, this sets its title to the display filename but copies the previous track's artist, album, and artwork. Queues from All Tracks can span albums, so subsequent tracks show stale artist/artwork and a filename (often including the extension) instead of the track title. Update these fields from the selected queue item's metadata.
Useful? React with 👍 / 👎.
Add dedicated Audio tab with MediaStore scanning, album queues, and background playback. Scan audio albums, artists, tracks, and album art URIs without polluting video folders or tabs; provide browsing across albums, all tracks, and artists; render an audio-mode player surface without video gestures; and integrate album queue navigation with MediaPlaybackService. Verified - git diff --check clean - InitOrderChecker verified 0 violations in AudioViewModel and PlayerViewModel - Added unit tests in AudioModelsTest, MainTabsTest, and BrowserPreferencesLayoutTest
…Surface - PullRefreshBox: pass MutableState<Boolean> isRefreshing instead of Boolean refreshing. - ExpressiveChoiceRow: resolve string resources outside the non-composable labelOf lambda. - EmptyState: supply missing icon parameter (Audiotrack for empty library, Search for empty query). - AudioPlayerSurface: correct RepeatMode package import to app.aryan447.mpvium.ui.player.RepeatMode. - AudioPlayerSurface: collect paused, pos, and duration from MPVLib property flows. - AudioPlayerSurface: replace nonexistent togglePause() with viewModel.pauseUnpause(). - AudioPlayerSurface: add missing player transport string resources in strings.xml. - AudioPlayerSurface: safe-call playerActivity?.getPlaylistItemTitle() and invoke public viewModel.playPlaylistItem().
e4edd3a to
106a26d
Compare
Summary
MainTab.AUDIOat canonical index 6) with MediaStore audio scanning across albums, artists, and tracks.FileTypeUtils.AUDIO_EXTENSIONS) to prevent polluting existing video folders or tabs.LocalAlbumgenerates composite IDs fromalbum + artist(never title alone).layout_audio), All tracks, and Artists, with Album detail screen.AudioPlayerSurfacewith album artwork and video gestures disabled.MediaPlaybackServicewith notification queue controls and graceful handling of deniedPOST_NOTIFICATIONSpermission.Before / After
How measured
Static verification with
ViewModelInitOrderTestlogic (0 violations across all ViewModels). Diff checks clean withgit diff --check.Verification
git diff --checkclean (0 errors)AudioModelsTest,MainTabsTest,BrowserPreferencesLayoutTestCHANGELOG.mdupdated underUnreleased->Addedres/values/strings.xmlChangelog
MainTab.AUDIOat canonical index 6): dedicated library for local audio with MediaStore scanning across albums, artists, and tracks, plus album artwork support without polluting video folders or tabs. Automatically hides when no audio exists on device while staying toggleable in Settings → Appearance.layout_audio), All tracks, and Artists, with album detail view and queue playback.MediaPlaybackService, with graceful handling whenPOST_NOTIFICATIONSpermission is denied.Risks
None identified; video scanning, existing video tabs, and video folder logic remain completely untouched.
Summary by Sourcery
Add a complete local audio library and queue-based playback experience without affecting existing video browsing or playback.
New Features:
Bug Fixes:
Enhancements:
Documentation:
Tests: