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