mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
feat: sort smart search
Smart search currently returns a list of assets by their score. It would be nice if we could instead filter assets, and then list them by date. This is the default behaviour of other platforms.
This commit is contained in:
@@ -8,6 +8,8 @@ import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
|
||||
part 'paginated_search.provider.g.dart';
|
||||
|
||||
final searchGroupByProvider = StateProvider<GroupAssetsBy>((ref) => GroupAssetsBy.none);
|
||||
|
||||
final paginatedSearchProvider = StateNotifierProvider<PaginatedSearchNotifier, SearchResult>(
|
||||
(ref) => PaginatedSearchNotifier(ref.watch(searchServiceProvider)),
|
||||
);
|
||||
@@ -41,6 +43,7 @@ class PaginatedSearchNotifier extends StateNotifier<SearchResult> {
|
||||
@riverpod
|
||||
Future<RenderList> paginatedSearchRenderList(Ref ref) {
|
||||
final result = ref.watch(paginatedSearchProvider);
|
||||
final groupBy = ref.watch(searchGroupByProvider);
|
||||
final timelineService = ref.watch(timelineServiceProvider);
|
||||
return timelineService.getTimelineFromAssets(result.assets, GroupAssetsBy.none);
|
||||
return timelineService.getTimelineFromAssets(result.assets, groupBy);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ part of 'paginated_search.provider.dart';
|
||||
// **************************************************************************
|
||||
|
||||
String _$paginatedSearchRenderListHash() =>
|
||||
r'22d715ff7864e5a946be38322ce7813616f899c2';
|
||||
r'bb1ea9153b2a186778420426f1fb1add6d6a9140';
|
||||
|
||||
/// See also [paginatedSearchRenderList].
|
||||
@ProviderFor(paginatedSearchRenderList)
|
||||
|
||||
Reference in New Issue
Block a user