mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-09-30 21:29:36 +02:00
17 lines
724 B
Dart
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());
|
|
|
|
/// Playback only reads artwork already saved with a download. Opening a player
|
|
/// must never search other extensions or trigger an artwork download.
|
|
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);
|
|
});
|