Add offline playlist caching with live download status (+ justfile)#142
Open
Aron-Magg wants to merge 2 commits into
Open
Add offline playlist caching with live download status (+ justfile)#142Aron-Magg wants to merge 2 commits into
Aron-Magg wants to merge 2 commits into
Conversation
Add a justfile wrapping the npm scripts (dev, lint, web build) plus local Gradle build recipes (build-android / build-android-debug) that generate the native project via expo prebuild — no EAS account needed. EAS-based builds are kept under build-eas-*. Also add the eas-cli dev dependency and an ios run script. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Keep selected Navidrome/Subsonic playlists available offline (Android): - "Keep offline" toggle in the playlist options downloads every song and persists the choice in settings (cachedPlaylists). - Playlists marked offline are re-synced automatically on launch when a connection is available (new songs downloaded, removed ones pruned), and left untouched when offline. - Per-song download status: live percentage while downloading, cloud icon once cached (reactive via a useSyncExternalStore store). - Cached playlists show their on-disk size next to the minutes/songs stats, and a cloud indicator in the Playlists tab. - Removing a playlist from offline frees its songs, preserving any shared with another kept playlist. Native only: web has no real file system (service-worker caching). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
Adds the ability to keep selected Navidrome/Subsonic playlists available
offline on Android, with live per-song download status and on-disk size
reporting. Also adds a
justfileto streamline common dev/build commands.Offline playlist caching
of the playlist and persists the choice in settings (
cachedPlaylists).is available: newly added songs are downloaded, removed ones are pruned.
When offline, the cached copy is left untouched.
cloud icon once cached. Reactive via a small
useSyncExternalStorestore,so the UI updates without reopening the screen.
minutes/songs stats, and a cloud indicator in the Playlists tab.
any songs shared with another kept playlist.
Implementation notes
app/utils/offlineSync.native.js(web no-op) holds add/remove/sync +garbage-collection logic.
app/components/OfflineSync.jsis a headless component mounted in theprovider tree that runs the sync on launch.
downloadSongnow reports progress viaexpo-file-systemcreateDownloadResumableand emits start/progress/finish to the store.(
convertToTrackalready prefers the local file when cached).Keep offline,Remove from offline(en + it; otherlocales fall back to en).
Platform support
Offline playlist caching relies on the device file system and is Android
only; the web build keeps using its service-worker caching (no-op shims).
Tooling
justfilewrapping the npm scripts and local Gradle builds(
just build-androidrunsexpo prebuild+gradlew assembleRelease,no EAS account required). EAS builds are kept under
build-eas-*.Testing
just lint(project ESLint) passes.just build-android.