Skip to content

feat: add network file caching for SMB/NFS mounts#27

Open
pythoninthegrass wants to merge 1 commit intomainfrom
begin-backlog-task-295
Open

feat: add network file caching for SMB/NFS mounts#27
pythoninthegrass wants to merge 1 commit intomainfrom
begin-backlog-task-295

Conversation

@pythoninthegrass
Copy link
Collaborator

Add optional local caching for audio files on network mounts. When enabled in Settings > Audio, files are copied to a local cache directory before playback. Cache uses LRU eviction with configurable max size (0.5-20 GB, default 2 GB) and can optionally persist across restarts.

  • NetworkFileCache: disk-based LRU cache with SHA-256 path hashing, extension preservation for Rodio format detection, rebuild-from-disk on startup, and byte-based eviction
  • Mount detection: macOS (libc::statfs MNT_LOCAL), Linux (/proc/mounts fs type matching), Windows (UNC paths + GetDriveTypeW DRIVE_REMOTE)
  • Audio pipeline integration: resolve_cached_path intercepts audio_load and audio_load_and_play commands transparently
  • Exit cleanup: refactor .run() to .build() + .run() with RunEvent::Exit handler that purges non-persistent cache
  • Settings UI: Audio section with enable toggle, persistent toggle, size slider, cache status card, and purge button
  • 16 new Rust unit tests, 7 Playwright E2E tests

Add optional local caching for audio files on network mounts. When
enabled in Settings > Audio, files are copied to a local cache directory
before playback. Cache uses LRU eviction with configurable max size
(0.5-20 GB, default 2 GB) and can optionally persist across restarts.

- NetworkFileCache: disk-based LRU cache with SHA-256 path hashing,
  extension preservation for Rodio format detection, rebuild-from-disk
  on startup, and byte-based eviction
- Mount detection: macOS (libc::statfs MNT_LOCAL), Linux (/proc/mounts
  fs type matching), Windows (UNC paths + GetDriveTypeW DRIVE_REMOTE)
- Audio pipeline integration: resolve_cached_path intercepts audio_load
  and audio_load_and_play commands transparently
- Exit cleanup: refactor .run() to .build() + .run() with RunEvent::Exit
  handler that purges non-persistent cache
- Settings UI: Audio section with enable toggle, persistent toggle,
  size slider, cache status card, and purge button
- 16 new Rust unit tests, 7 Playwright E2E tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant