diff --git a/mobile/lib/modules/search/providers/all_motion_photos.provider.dart b/mobile/lib/modules/search/providers/all_motion_photos.provider.dart index 7e20fa793f..3782eb6995 100644 --- a/mobile/lib/modules/search/providers/all_motion_photos.provider.dart +++ b/mobile/lib/modules/search/providers/all_motion_photos.provider.dart @@ -1,29 +1,12 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:immich_mobile/shared/models/asset.dart'; -import 'package:immich_mobile/shared/providers/api.provider.dart'; import 'package:immich_mobile/shared/providers/db.provider.dart'; +import 'package:isar/isar.dart'; final allMotionPhotosProvider = FutureProvider>( (ref) async { - final search = await ref.watch(apiServiceProvider).searchApi.search( - motion: true, - ); - - if (search == null) { - return []; - } - return ref.watch(dbProvider) - .assets - .getAllByRemoteId( - search.assets.items.map((e) => e.id), - ); - - - /// This works offline, but we use the above - /* - return ref.watch(dbProvider).assets - .filter() - .livePhotoVideoIdIsNotNull() - .findAll(); - */ + .assets + .filter() + .livePhotoVideoIdIsNotNull() + .findAll(); }); diff --git a/mobile/lib/modules/search/providers/recently_added.provider.dart b/mobile/lib/modules/search/providers/recently_added.provider.dart index a4c7a829b4..5cac2fc4cf 100644 --- a/mobile/lib/modules/search/providers/recently_added.provider.dart +++ b/mobile/lib/modules/search/providers/recently_added.provider.dart @@ -1,20 +1,12 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:immich_mobile/shared/models/asset.dart'; -import 'package:immich_mobile/shared/providers/api.provider.dart'; import 'package:immich_mobile/shared/providers/db.provider.dart'; +import 'package:isar/isar.dart'; final recentlyAddedProvider = FutureProvider>( (ref) async { - final search = await ref.watch(apiServiceProvider).searchApi.search( - recent: true, - ); - - if (search == null) { - return []; - } - return ref.watch(dbProvider) .assets - .getAllByRemoteId( - search.assets.items.map((e) => e.id), - ); + .where() + .sortByFileCreatedAtDesc() + .findAll(); });