mirror of
https://github.com/immich-app/immich.git
synced 2026-03-22 16:19:24 +03:00
fix(mobile): restrict trashed asset migration to Android platform (#26726)
* fix(migration): restrict trashed asset migration to Android platform * playbackStyle migration add different log depending on platform
This commit is contained in:
@@ -420,21 +420,24 @@ Future<void> _populateLocalAssetPlaybackStyle(Drift db) async {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
final trashedAssetMap = await nativeApi.getTrashedAssets();
|
if (Platform.isAndroid) {
|
||||||
for (final entry in trashedAssetMap.cast<String, List<Object?>>().entries) {
|
final trashedAssetMap = await nativeApi.getTrashedAssets();
|
||||||
final assets = entry.value.cast<PlatformAsset>();
|
for (final entry in trashedAssetMap.cast<String, List<Object?>>().entries) {
|
||||||
await db.batch((batch) {
|
final assets = entry.value.cast<PlatformAsset>();
|
||||||
for (final asset in assets) {
|
await db.batch((batch) {
|
||||||
batch.update(
|
for (final asset in assets) {
|
||||||
db.trashedLocalAssetEntity,
|
batch.update(
|
||||||
TrashedLocalAssetEntityCompanion(playbackStyle: Value(_toPlaybackStyle(asset.playbackStyle))),
|
db.trashedLocalAssetEntity,
|
||||||
where: (t) => t.id.equals(asset.id),
|
TrashedLocalAssetEntityCompanion(playbackStyle: Value(_toPlaybackStyle(asset.playbackStyle))),
|
||||||
);
|
where: (t) => t.id.equals(asset.id),
|
||||||
}
|
);
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
dPrint(() => "[MIGRATION] Successfully populated playbackStyle for local and trashed assets");
|
||||||
|
} else {
|
||||||
|
dPrint(() => "[MIGRATION] Successfully populated playbackStyle for local assets");
|
||||||
}
|
}
|
||||||
|
|
||||||
dPrint(() => "[MIGRATION] Successfully populated playbackStyle for local and trashed assets");
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
dPrint(() => "[MIGRATION] Error while populating playbackStyle: $error");
|
dPrint(() => "[MIGRATION] Error while populating playbackStyle: $error");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user