mirror of
https://github.com/austinried/subtracks.git
synced 2026-02-10 06:52:43 +01:00
context menu base and move query to state
This commit is contained in:
31
lib/app/state/lists.dart
Normal file
31
lib/app/state/lists.dart
Normal file
@@ -0,0 +1,31 @@
|
||||
import 'package:fast_immutable_collections/fast_immutable_collections.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
|
||||
import '../../database/query.dart';
|
||||
import 'source.dart';
|
||||
|
||||
final albumsQueryProvider = Provider<AlbumsQuery>((ref) {
|
||||
final sourceId = ref.watch(sourceIdProvider);
|
||||
|
||||
return AlbumsQuery(
|
||||
sourceId: sourceId,
|
||||
sort: IList([
|
||||
SortingTerm.albumsDesc(AlbumsColumn.created),
|
||||
]),
|
||||
);
|
||||
});
|
||||
|
||||
final songsQueryProvider = Provider<SongsQuery>((ref) {
|
||||
final sourceId = ref.watch(sourceIdProvider);
|
||||
|
||||
return SongsQuery(
|
||||
sourceId: sourceId,
|
||||
sort: IList([
|
||||
SortingTerm.songsAsc(SongsColumn.albumArtist),
|
||||
SortingTerm.songsAsc(SongsColumn.album),
|
||||
SortingTerm.songsAsc(SongsColumn.disc),
|
||||
SortingTerm.songsAsc(SongsColumn.track),
|
||||
SortingTerm.songsAsc(SongsColumn.title),
|
||||
]),
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user