bvandeusen
16669a0365
feat(flutter/cache): AudioCacheManager — pin/unpin/evict + tiered LRU
...
API:
- isCached(trackId), pathFor(trackId)
- pin(trackId, source) — dio.download → drift index entry
- unpin(trackId), clearAll()
- usageBytes(), evict(targetBytes)
Eviction order: incidental → autoPrefetch → autoPlaylist → autoLiked.
'manual' never evicts via cap-driven eviction; only clearAll() removes
operator-pinned tracks.
Two providers:
- appDbProvider — singleton AppDb per run
- audioCacheManagerProvider — wraps the AppDb + dioProvider
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-09 23:17:14 -04:00
bvandeusen
2bcbb53c49
feat(flutter/cache): connectivityProvider + cacheSettingsProvider
...
connectivityProvider — StreamProvider<bool>; true when any connectivity
result is non-none. No Wi-Fi gate per operator decision.
cacheSettingsProvider — AsyncNotifier<CacheSettings> persisting
capBytes / prefetchWindow / cacheLikedTracks via flutter_secure_storage.
Defaults: 5 GB cap, 5-track prefetch, cache liked = on.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-09 23:15:17 -04:00
bvandeusen
326b7008a9
feat(flutter/cache): drift schema + new deps + CI codegen step ( #357 plan B)
...
Adds the offline-mode foundation:
- pubspec deps: drift, drift_flutter, sqlite3_flutter_libs,
connectivity_plus + drift_dev/build_runner (dev)
- lib/cache/db.dart with 8 tables: CachedArtists/Albums/Tracks/Likes/
Playlists/PlaylistTracks + AudioCacheIndex + SyncMetadata
- *.g.dart added to .gitignore (build_runner regenerates per build)
- CI workflow gains a 'Codegen (drift)' step between pub get and
analyze so the generated symbols exist when analyze runs
CacheSource enum drives tiered LRU eviction (manual/autoLiked/
autoPlaylist/autoPrefetch/incidental). Subsequent commits add the
sync controller, audio cache manager, prefetcher, settings UI.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-09 23:07:34 -04:00