diff --git a/mobile/lib/utils/migration.dart b/mobile/lib/utils/migration.dart index efb4d60369..6b6f1b251b 100644 --- a/mobile/lib/utils/migration.dart +++ b/mobile/lib/utils/migration.dart @@ -420,21 +420,24 @@ Future _populateLocalAssetPlaybackStyle(Drift db) async { }); } - final trashedAssetMap = await nativeApi.getTrashedAssets(); - for (final entry in trashedAssetMap.cast>().entries) { - final assets = entry.value.cast(); - await db.batch((batch) { - for (final asset in assets) { - batch.update( - db.trashedLocalAssetEntity, - TrashedLocalAssetEntityCompanion(playbackStyle: Value(_toPlaybackStyle(asset.playbackStyle))), - where: (t) => t.id.equals(asset.id), - ); - } - }); + if (Platform.isAndroid) { + final trashedAssetMap = await nativeApi.getTrashedAssets(); + for (final entry in trashedAssetMap.cast>().entries) { + final assets = entry.value.cast(); + await db.batch((batch) { + for (final asset in assets) { + batch.update( + db.trashedLocalAssetEntity, + 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) { dPrint(() => "[MIGRATION] Error while populating playbackStyle: $error"); }