mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat: show stacks in asset viewer (#19935)
* feat: show stacks in asset viewer * fix: global key issue and flash on stack asset change * feat(mobile): stack and unstack action (#19941) * feat(mobile): stack and unstack action * add custom model * use stackId from ActionSource * Update mobile/lib/providers/infrastructure/action.provider.dart Co-authored-by: shenlong <139912620+shenlong-tanwen@users.noreply.github.com> --------- Co-authored-by: shenlong <139912620+shenlong-tanwen@users.noreply.github.com> * fix: lint * fix: bad merge * fix: test --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> Co-authored-by: Alex <alex.tran1502@gmail.com> Co-authored-by: Daimolean <92239625+wuzihao051119@users.noreply.github.com> Co-authored-by: wuzihao051119 <wuzihao051119@outlook.com>
This commit is contained in:
parent
546f841b2c
commit
f32cd74232
41 changed files with 1568 additions and 802 deletions
|
|
@ -29,6 +29,7 @@ typedef $$RemoteAssetEntityTableCreateCompanionBuilder
|
|||
i0.Value<DateTime?> deletedAt,
|
||||
i0.Value<String?> livePhotoVideoId,
|
||||
required i2.AssetVisibility visibility,
|
||||
i0.Value<String?> stackId,
|
||||
});
|
||||
typedef $$RemoteAssetEntityTableUpdateCompanionBuilder
|
||||
= i1.RemoteAssetEntityCompanion Function({
|
||||
|
|
@ -48,6 +49,7 @@ typedef $$RemoteAssetEntityTableUpdateCompanionBuilder
|
|||
i0.Value<DateTime?> deletedAt,
|
||||
i0.Value<String?> livePhotoVideoId,
|
||||
i0.Value<i2.AssetVisibility> visibility,
|
||||
i0.Value<String?> stackId,
|
||||
});
|
||||
|
||||
final class $$RemoteAssetEntityTableReferences extends i0.BaseReferences<
|
||||
|
|
@ -145,6 +147,9 @@ class $$RemoteAssetEntityTableFilterComposer
|
|||
column: $table.visibility,
|
||||
builder: (column) => i0.ColumnWithTypeConverterFilters(column));
|
||||
|
||||
i0.ColumnFilters<String> get stackId => $composableBuilder(
|
||||
column: $table.stackId, builder: (column) => i0.ColumnFilters(column));
|
||||
|
||||
i5.$$UserEntityTableFilterComposer get ownerId {
|
||||
final i5.$$UserEntityTableFilterComposer composer = $composerBuilder(
|
||||
composer: this,
|
||||
|
|
@ -231,6 +236,9 @@ class $$RemoteAssetEntityTableOrderingComposer
|
|||
column: $table.visibility,
|
||||
builder: (column) => i0.ColumnOrderings(column));
|
||||
|
||||
i0.ColumnOrderings<String> get stackId => $composableBuilder(
|
||||
column: $table.stackId, builder: (column) => i0.ColumnOrderings(column));
|
||||
|
||||
i5.$$UserEntityTableOrderingComposer get ownerId {
|
||||
final i5.$$UserEntityTableOrderingComposer composer = $composerBuilder(
|
||||
composer: this,
|
||||
|
|
@ -309,6 +317,9 @@ class $$RemoteAssetEntityTableAnnotationComposer
|
|||
$composableBuilder(
|
||||
column: $table.visibility, builder: (column) => column);
|
||||
|
||||
i0.GeneratedColumn<String> get stackId =>
|
||||
$composableBuilder(column: $table.stackId, builder: (column) => column);
|
||||
|
||||
i5.$$UserEntityTableAnnotationComposer get ownerId {
|
||||
final i5.$$UserEntityTableAnnotationComposer composer = $composerBuilder(
|
||||
composer: this,
|
||||
|
|
@ -373,6 +384,7 @@ class $$RemoteAssetEntityTableTableManager extends i0.RootTableManager<
|
|||
i0.Value<DateTime?> deletedAt = const i0.Value.absent(),
|
||||
i0.Value<String?> livePhotoVideoId = const i0.Value.absent(),
|
||||
i0.Value<i2.AssetVisibility> visibility = const i0.Value.absent(),
|
||||
i0.Value<String?> stackId = const i0.Value.absent(),
|
||||
}) =>
|
||||
i1.RemoteAssetEntityCompanion(
|
||||
name: name,
|
||||
|
|
@ -391,6 +403,7 @@ class $$RemoteAssetEntityTableTableManager extends i0.RootTableManager<
|
|||
deletedAt: deletedAt,
|
||||
livePhotoVideoId: livePhotoVideoId,
|
||||
visibility: visibility,
|
||||
stackId: stackId,
|
||||
),
|
||||
createCompanionCallback: ({
|
||||
required String name,
|
||||
|
|
@ -409,6 +422,7 @@ class $$RemoteAssetEntityTableTableManager extends i0.RootTableManager<
|
|||
i0.Value<DateTime?> deletedAt = const i0.Value.absent(),
|
||||
i0.Value<String?> livePhotoVideoId = const i0.Value.absent(),
|
||||
required i2.AssetVisibility visibility,
|
||||
i0.Value<String?> stackId = const i0.Value.absent(),
|
||||
}) =>
|
||||
i1.RemoteAssetEntityCompanion.insert(
|
||||
name: name,
|
||||
|
|
@ -427,6 +441,7 @@ class $$RemoteAssetEntityTableTableManager extends i0.RootTableManager<
|
|||
deletedAt: deletedAt,
|
||||
livePhotoVideoId: livePhotoVideoId,
|
||||
visibility: visibility,
|
||||
stackId: stackId,
|
||||
),
|
||||
withReferenceMapper: (p0) => p0
|
||||
.map((e) => (
|
||||
|
|
@ -602,6 +617,12 @@ class $RemoteAssetEntityTable extends i3.RemoteAssetEntity
|
|||
type: i0.DriftSqlType.int, requiredDuringInsert: true)
|
||||
.withConverter<i2.AssetVisibility>(
|
||||
i1.$RemoteAssetEntityTable.$convertervisibility);
|
||||
static const i0.VerificationMeta _stackIdMeta =
|
||||
const i0.VerificationMeta('stackId');
|
||||
@override
|
||||
late final i0.GeneratedColumn<String> stackId = i0.GeneratedColumn<String>(
|
||||
'stack_id', aliasedName, true,
|
||||
type: i0.DriftSqlType.string, requiredDuringInsert: false);
|
||||
@override
|
||||
List<i0.GeneratedColumn> get $columns => [
|
||||
name,
|
||||
|
|
@ -619,7 +640,8 @@ class $RemoteAssetEntityTable extends i3.RemoteAssetEntity
|
|||
thumbHash,
|
||||
deletedAt,
|
||||
livePhotoVideoId,
|
||||
visibility
|
||||
visibility,
|
||||
stackId
|
||||
];
|
||||
@override
|
||||
String get aliasedName => _alias ?? actualTableName;
|
||||
|
|
@ -703,6 +725,10 @@ class $RemoteAssetEntityTable extends i3.RemoteAssetEntity
|
|||
livePhotoVideoId.isAcceptableOrUnknown(
|
||||
data['live_photo_video_id']!, _livePhotoVideoIdMeta));
|
||||
}
|
||||
if (data.containsKey('stack_id')) {
|
||||
context.handle(_stackIdMeta,
|
||||
stackId.isAcceptableOrUnknown(data['stack_id']!, _stackIdMeta));
|
||||
}
|
||||
return context;
|
||||
}
|
||||
|
||||
|
|
@ -748,6 +774,8 @@ class $RemoteAssetEntityTable extends i3.RemoteAssetEntity
|
|||
visibility: i1.$RemoteAssetEntityTable.$convertervisibility.fromSql(
|
||||
attachedDatabase.typeMapping.read(
|
||||
i0.DriftSqlType.int, data['${effectivePrefix}visibility'])!),
|
||||
stackId: attachedDatabase.typeMapping
|
||||
.read(i0.DriftSqlType.string, data['${effectivePrefix}stack_id']),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -785,6 +813,7 @@ class RemoteAssetEntityData extends i0.DataClass
|
|||
final DateTime? deletedAt;
|
||||
final String? livePhotoVideoId;
|
||||
final i2.AssetVisibility visibility;
|
||||
final String? stackId;
|
||||
const RemoteAssetEntityData(
|
||||
{required this.name,
|
||||
required this.type,
|
||||
|
|
@ -801,7 +830,8 @@ class RemoteAssetEntityData extends i0.DataClass
|
|||
this.thumbHash,
|
||||
this.deletedAt,
|
||||
this.livePhotoVideoId,
|
||||
required this.visibility});
|
||||
required this.visibility,
|
||||
this.stackId});
|
||||
@override
|
||||
Map<String, i0.Expression> toColumns(bool nullToAbsent) {
|
||||
final map = <String, i0.Expression>{};
|
||||
|
|
@ -841,6 +871,9 @@ class RemoteAssetEntityData extends i0.DataClass
|
|||
map['visibility'] = i0.Variable<int>(
|
||||
i1.$RemoteAssetEntityTable.$convertervisibility.toSql(visibility));
|
||||
}
|
||||
if (!nullToAbsent || stackId != null) {
|
||||
map['stack_id'] = i0.Variable<String>(stackId);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
|
|
@ -866,6 +899,7 @@ class RemoteAssetEntityData extends i0.DataClass
|
|||
livePhotoVideoId: serializer.fromJson<String?>(json['livePhotoVideoId']),
|
||||
visibility: i1.$RemoteAssetEntityTable.$convertervisibility
|
||||
.fromJson(serializer.fromJson<int>(json['visibility'])),
|
||||
stackId: serializer.fromJson<String?>(json['stackId']),
|
||||
);
|
||||
}
|
||||
@override
|
||||
|
|
@ -890,6 +924,7 @@ class RemoteAssetEntityData extends i0.DataClass
|
|||
'livePhotoVideoId': serializer.toJson<String?>(livePhotoVideoId),
|
||||
'visibility': serializer.toJson<int>(
|
||||
i1.$RemoteAssetEntityTable.$convertervisibility.toJson(visibility)),
|
||||
'stackId': serializer.toJson<String?>(stackId),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -909,7 +944,8 @@ class RemoteAssetEntityData extends i0.DataClass
|
|||
i0.Value<String?> thumbHash = const i0.Value.absent(),
|
||||
i0.Value<DateTime?> deletedAt = const i0.Value.absent(),
|
||||
i0.Value<String?> livePhotoVideoId = const i0.Value.absent(),
|
||||
i2.AssetVisibility? visibility}) =>
|
||||
i2.AssetVisibility? visibility,
|
||||
i0.Value<String?> stackId = const i0.Value.absent()}) =>
|
||||
i1.RemoteAssetEntityData(
|
||||
name: name ?? this.name,
|
||||
type: type ?? this.type,
|
||||
|
|
@ -932,6 +968,7 @@ class RemoteAssetEntityData extends i0.DataClass
|
|||
? livePhotoVideoId.value
|
||||
: this.livePhotoVideoId,
|
||||
visibility: visibility ?? this.visibility,
|
||||
stackId: stackId.present ? stackId.value : this.stackId,
|
||||
);
|
||||
RemoteAssetEntityData copyWithCompanion(i1.RemoteAssetEntityCompanion data) {
|
||||
return RemoteAssetEntityData(
|
||||
|
|
@ -959,6 +996,7 @@ class RemoteAssetEntityData extends i0.DataClass
|
|||
: this.livePhotoVideoId,
|
||||
visibility:
|
||||
data.visibility.present ? data.visibility.value : this.visibility,
|
||||
stackId: data.stackId.present ? data.stackId.value : this.stackId,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -980,7 +1018,8 @@ class RemoteAssetEntityData extends i0.DataClass
|
|||
..write('thumbHash: $thumbHash, ')
|
||||
..write('deletedAt: $deletedAt, ')
|
||||
..write('livePhotoVideoId: $livePhotoVideoId, ')
|
||||
..write('visibility: $visibility')
|
||||
..write('visibility: $visibility, ')
|
||||
..write('stackId: $stackId')
|
||||
..write(')'))
|
||||
.toString();
|
||||
}
|
||||
|
|
@ -1002,7 +1041,8 @@ class RemoteAssetEntityData extends i0.DataClass
|
|||
thumbHash,
|
||||
deletedAt,
|
||||
livePhotoVideoId,
|
||||
visibility);
|
||||
visibility,
|
||||
stackId);
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
|
|
@ -1022,7 +1062,8 @@ class RemoteAssetEntityData extends i0.DataClass
|
|||
other.thumbHash == this.thumbHash &&
|
||||
other.deletedAt == this.deletedAt &&
|
||||
other.livePhotoVideoId == this.livePhotoVideoId &&
|
||||
other.visibility == this.visibility);
|
||||
other.visibility == this.visibility &&
|
||||
other.stackId == this.stackId);
|
||||
}
|
||||
|
||||
class RemoteAssetEntityCompanion
|
||||
|
|
@ -1043,6 +1084,7 @@ class RemoteAssetEntityCompanion
|
|||
final i0.Value<DateTime?> deletedAt;
|
||||
final i0.Value<String?> livePhotoVideoId;
|
||||
final i0.Value<i2.AssetVisibility> visibility;
|
||||
final i0.Value<String?> stackId;
|
||||
const RemoteAssetEntityCompanion({
|
||||
this.name = const i0.Value.absent(),
|
||||
this.type = const i0.Value.absent(),
|
||||
|
|
@ -1060,6 +1102,7 @@ class RemoteAssetEntityCompanion
|
|||
this.deletedAt = const i0.Value.absent(),
|
||||
this.livePhotoVideoId = const i0.Value.absent(),
|
||||
this.visibility = const i0.Value.absent(),
|
||||
this.stackId = const i0.Value.absent(),
|
||||
});
|
||||
RemoteAssetEntityCompanion.insert({
|
||||
required String name,
|
||||
|
|
@ -1078,6 +1121,7 @@ class RemoteAssetEntityCompanion
|
|||
this.deletedAt = const i0.Value.absent(),
|
||||
this.livePhotoVideoId = const i0.Value.absent(),
|
||||
required i2.AssetVisibility visibility,
|
||||
this.stackId = const i0.Value.absent(),
|
||||
}) : name = i0.Value(name),
|
||||
type = i0.Value(type),
|
||||
id = i0.Value(id),
|
||||
|
|
@ -1101,6 +1145,7 @@ class RemoteAssetEntityCompanion
|
|||
i0.Expression<DateTime>? deletedAt,
|
||||
i0.Expression<String>? livePhotoVideoId,
|
||||
i0.Expression<int>? visibility,
|
||||
i0.Expression<String>? stackId,
|
||||
}) {
|
||||
return i0.RawValuesInsertable({
|
||||
if (name != null) 'name': name,
|
||||
|
|
@ -1119,6 +1164,7 @@ class RemoteAssetEntityCompanion
|
|||
if (deletedAt != null) 'deleted_at': deletedAt,
|
||||
if (livePhotoVideoId != null) 'live_photo_video_id': livePhotoVideoId,
|
||||
if (visibility != null) 'visibility': visibility,
|
||||
if (stackId != null) 'stack_id': stackId,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -1138,7 +1184,8 @@ class RemoteAssetEntityCompanion
|
|||
i0.Value<String?>? thumbHash,
|
||||
i0.Value<DateTime?>? deletedAt,
|
||||
i0.Value<String?>? livePhotoVideoId,
|
||||
i0.Value<i2.AssetVisibility>? visibility}) {
|
||||
i0.Value<i2.AssetVisibility>? visibility,
|
||||
i0.Value<String?>? stackId}) {
|
||||
return i1.RemoteAssetEntityCompanion(
|
||||
name: name ?? this.name,
|
||||
type: type ?? this.type,
|
||||
|
|
@ -1156,6 +1203,7 @@ class RemoteAssetEntityCompanion
|
|||
deletedAt: deletedAt ?? this.deletedAt,
|
||||
livePhotoVideoId: livePhotoVideoId ?? this.livePhotoVideoId,
|
||||
visibility: visibility ?? this.visibility,
|
||||
stackId: stackId ?? this.stackId,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -1213,6 +1261,9 @@ class RemoteAssetEntityCompanion
|
|||
.$RemoteAssetEntityTable.$convertervisibility
|
||||
.toSql(visibility.value));
|
||||
}
|
||||
if (stackId.present) {
|
||||
map['stack_id'] = i0.Variable<String>(stackId.value);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
|
|
@ -1234,7 +1285,8 @@ class RemoteAssetEntityCompanion
|
|||
..write('thumbHash: $thumbHash, ')
|
||||
..write('deletedAt: $deletedAt, ')
|
||||
..write('livePhotoVideoId: $livePhotoVideoId, ')
|
||||
..write('visibility: $visibility')
|
||||
..write('visibility: $visibility, ')
|
||||
..write('stackId: $stackId')
|
||||
..write(')'))
|
||||
.toString();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue