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';
|
2024-05-01 04:36:40 +02:00
|
|
|
import 'package:immich_mobile/entities/asset.entity.dart';
|
2024-05-02 22:59:14 +02:00
|
|
|
import 'package:immich_mobile/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
|
|
|
});
|