2023-03-25 05:44:53 +02:00
|
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
2024-01-05 23:23:58 +02:00
|
|
|
import 'package:immich_mobile/modules/home/ui/asset_grid/asset_grid_data_structure.dart';
|
2023-03-25 05:44:53 +02:00
|
|
|
import 'package:immich_mobile/shared/models/asset.dart';
|
|
|
|
import 'package:immich_mobile/shared/providers/db.provider.dart';
|
2024-01-05 23:23:58 +02:00
|
|
|
import 'package:immich_mobile/utils/renderlist_generator.dart';
|
2023-03-25 05:44:53 +02:00
|
|
|
|
2024-01-05 23:23:58 +02:00
|
|
|
final allVideoAssetsProvider = StreamProvider<RenderList>((ref) {
|
|
|
|
final query = ref
|
2023-12-26 23:41:51 +02:00
|
|
|
.watch(dbProvider)
|
2023-03-25 05:44:53 +02:00
|
|
|
.assets
|
|
|
|
.filter()
|
2024-01-05 23:23:58 +02:00
|
|
|
.isArchivedEqualTo(false)
|
|
|
|
.isTrashedEqualTo(false)
|
2023-12-26 23:41:51 +02:00
|
|
|
.typeEqualTo(AssetType.video)
|
2024-01-05 23:23:58 +02:00
|
|
|
.sortByFileCreatedAtDesc();
|
|
|
|
return renderListGenerator(query, ref);
|
2023-03-25 05:44:53 +02:00
|
|
|
});
|