Files
SpotiFLAC-Mobile/lib/providers/player_motion_artwork_provider.dart
T
zarzet cec9d5cbce feat(library): show saved animated artwork on local albums
Reuse downloaded motion artwork for local and downloaded album headers, with static fallbacks and reduced-motion support. Opening an album does not trigger an artwork search or download.
2026-09-25 01:21:10 +07:00

17 lines
724 B
Dart

import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:spotiflac_android/services/motion_artwork_store.dart';
typedef PlayerArtworkAlbum = ({String album, String artist});
final motionArtworkStoreProvider = Provider((ref) => MotionArtworkStore());
/// Player and local album pages read artwork already saved with a download.
/// Opening either must never search extensions or download more artwork.
final playerMotionArtworkProvider = FutureProvider.autoDispose
.family<MotionArtwork?, PlayerArtworkAlbum>((ref, album) async {
if (album.album.trim().isEmpty || album.artist.trim().isEmpty) {
return null;
}
return ref.watch(motionArtworkStoreProvider).find(album);
});