(
return (reader.readStringOrNull(offset)) as P;
case 15:
return (reader.readStringOrNull(offset)) as P;
+ case 16:
+ return (reader.readStringOrNull(offset)) as P;
default:
throw IsarError('Unknown property with id $propertyId');
}
@@ -1909,6 +1924,155 @@ extension ExifInfoQueryFilter
});
}
+ QueryBuilder> {
- final Asset _asset;
+ final String _stackId;
final Ref _ref;
- AssetStackNotifier(
- this._asset,
- this._ref,
- ) : super([]) {
- fetchStackChildren();
+ AssetStackNotifier(this._stackId, this._ref) : super([]) {
+ _fetchStack(_stackId);
}
- void fetchStackChildren() async {
- if (mounted) {
- state = await _ref.read(assetStackProvider(_asset).future);
+ void _fetchStack(String stackId) async {
+ if (!mounted) {
+ return;
+ }
+
+ final stack = await _ref.read(assetStackProvider(stackId).future);
+ if (stack.isNotEmpty) {
+ state = stack;
}
}
void removeChild(int index) {
if (index < state.length) {
state.removeAt(index);
+ state = List
, Asset>((ref, asset) async {
- // Guard [local asset]
- if (asset.remoteId == null) {
- return [];
- }
-
- return await ref
+ FutureProvider.autoDispose.family
, String>((ref, stackId) {
+ return ref
.watch(dbProvider)
.assets
.filter()
.isArchivedEqualTo(false)
.isTrashedEqualTo(false)
- .stackPrimaryAssetIdEqualTo(asset.remoteId)
- .sortByFileCreatedAtDesc()
+ .stackIdEqualTo(stackId)
+ // orders primary asset first as its ID is null
+ .sortByStackPrimaryAssetId()
+ .thenByFileCreatedAtDesc()
.findAll();
});
diff --git a/mobile/lib/providers/asset_viewer/is_motion_video_playing.provider.dart b/mobile/lib/providers/asset_viewer/is_motion_video_playing.provider.dart
new file mode 100644
index 0000000000000..4af061f9548c1
--- /dev/null
+++ b/mobile/lib/providers/asset_viewer/is_motion_video_playing.provider.dart
@@ -0,0 +1,23 @@
+import 'package:hooks_riverpod/hooks_riverpod.dart';
+
+/// Whether to display the video part of a motion photo
+final isPlayingMotionVideoProvider =
+ StateNotifierProvider