yaml
This commit is contained in:
parent
d205277cdd
commit
d1cab09a4f
9 changed files with 850 additions and 140 deletions
|
|
@ -195,6 +195,23 @@ final libraryIndexProvider =
|
|||
return controller;
|
||||
});
|
||||
|
||||
/// Recently-added albums (`getAlbumList2` type `newest`) — a discovery shelf on
|
||||
/// the Home tab. Small page; the Home shelf shows the first handful.
|
||||
final newestAlbumsProvider = FutureProvider<List<Album>>((ref) async {
|
||||
final client = ref.watch(subsonicClientProvider);
|
||||
if (client == null) return const [];
|
||||
return client.getAlbumList2(type: 'newest', size: 20);
|
||||
});
|
||||
|
||||
/// A random album shelf (`getAlbumList2` type `random`). Re-rolls when
|
||||
/// [rediscoverSeedProvider] bumps so it shares the Home "shuffle" affordance.
|
||||
final randomAlbumsProvider = FutureProvider<List<Album>>((ref) async {
|
||||
ref.watch(rediscoverSeedProvider);
|
||||
final client = ref.watch(subsonicClientProvider);
|
||||
if (client == null) return const [];
|
||||
return client.getAlbumList2(type: 'random', size: 20);
|
||||
});
|
||||
|
||||
final artistProvider = FutureProvider.family<Artist, String>((ref, id) async {
|
||||
final client = ref.watch(subsonicClientProvider);
|
||||
if (client == null) throw StateError('Not connected');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue