mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
17 lines
435 B
Dart
17 lines
435 B
Dart
part of '../spotify.dart';
|
|
|
|
final artistTopTracksProvider =
|
|
FutureProvider.autoDispose.family<List<Track>, String>(
|
|
(ref, artistId) async {
|
|
ref.cacheFor();
|
|
|
|
final spotify = ref.watch(spotifyProvider);
|
|
final market = ref.watch(userPreferencesProvider.select((s) => s.market));
|
|
final tracks = await spotify.invoke(
|
|
(api) => api.artists.topTracks(artistId, market),
|
|
);
|
|
|
|
return tracks.toList();
|
|
},
|
|
);
|