4 Commits

Author SHA1 Message Date
bvandeusen b6d6f22598 feat(flutter/player): AlbumCoverCache for lock-screen artwork
Fetches album cover bytes via the authenticated dio and writes to
<applicationCacheDirectory>/album_covers/<albumId>.jpg. Returns the
local path so MediaItem.artUri can point at a file:// URI — Android's
MediaSession framework fetches artUri itself without our Bearer
header, so a pre-fetched local file is the workaround.

Concurrent callers for the same albumId dedupe to one fetch via an
in-flight Future map. Any failure (network / 4xx / 5xx / disk full /
empty id) returns null without throwing — playback continues with
the system's generic music icon, same UX as today.

No eviction — covers are tiny, OS clears cache when space is tight.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 12:53:20 -04:00
bvandeusen 1ad67dbe59 fix(flutter/test): tolerate Riverpod 3's ProviderException wrapper 2026-05-08 14:43:31 -04:00
bvandeusen f27e83612d fix(flutter): two test environment issues from CI
smoke_test was hanging in pumpAndSettle because real
flutter_secure_storage MethodChannel calls don't resolve in widget
tests (no platform channel registered). Override secureStorageProvider
with a mocktail FlutterSecureStorage that returns null for every read,
so the GoRouter redirect resolves and ServerUrlScreen renders.

player_provider_test second case was crashing because constructing
MinstrelAudioHandler() instantiates just_audio's AudioPlayer, which
calls setMethodCallHandler during construction — that asserts unless
the WidgetsFlutterBinding is initialized. Add
TestWidgetsFlutterBinding.ensureInitialized() at the top of main().

Both are unit-test plumbing fixes; no production code change.
2026-05-02 19:36:27 -04:00
bvandeusen 80f98b3243 feat(flutter/player): MinstrelAudioHandler + just_audio + audio_service
audio_service runs the handler in a background isolate; UI watches
playbackState/mediaItem/queue streams through Riverpod. AndroidManifest
gets the foreground-service media-playback permission; Info.plist gets
UIBackgroundModes=audio. Bearer token attached to stream URLs via
just_audio's per-source headers.
2026-05-02 17:37:14 -04:00