Skip to content

Add offline playlist caching with live download status (+ justfile)#142

Open
Aron-Magg wants to merge 2 commits into
sawyerf:mainfrom
Aron-Magg:offline-playlist-cache
Open

Add offline playlist caching with live download status (+ justfile)#142
Aron-Magg wants to merge 2 commits into
sawyerf:mainfrom
Aron-Magg:offline-playlist-cache

Conversation

@Aron-Magg

Copy link
Copy Markdown

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 justfile to streamline common dev/build commands.

Offline playlist caching

  • Keep offline toggle in the playlist options menu downloads every song
    of the playlist and persists the choice in settings (cachedPlaylists).
  • Kept playlists are re-synced automatically on launch when a connection
    is available: newly added songs are downloaded, removed ones are pruned.
    When offline, the cached copy is left untouched.
  • Live download status per song: a percentage while downloading, then a
    cloud icon once cached. Reactive via a small useSyncExternalStore store,
    so the UI updates without reopening the screen.
  • Cached playlists show the disk space they occupy next to the
    minutes/songs stats, and a cloud indicator in the Playlists tab.
  • Remove from offline unmarks a playlist and frees its songs, preserving
    any songs shared with another kept playlist.

Implementation notes

  • New app/utils/offlineSync.native.js (web no-op) holds add/remove/sync +
    garbage-collection logic.
  • app/components/OfflineSync.js is a headless component mounted in the
    provider tree that runs the sync on launch.
  • downloadSong now reports progress via expo-file-system
    createDownloadResumable and emits start/progress/finish to the store.
  • Reuses the existing on-disk cache and player URL resolution
    (convertToTrack already prefers the local file when cached).
  • New i18n keys: Keep offline, Remove from offline (en + it; other
    locales 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

  • Adds a justfile wrapping the npm scripts and local Gradle builds
    (just build-android runs expo prebuild + gradlew assembleRelease,
    no EAS account required). EAS builds are kept under build-eas-*.

Testing

  • just lint (project ESLint) passes.
  • Local release APK builds successfully via just build-android.
  • Manual runtime testing of the full flow is still recommended.

Maggisano Aron and others added 2 commits June 15, 2026 01:28
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants