mirror of
https://github.com/immich-app/immich.git
synced 2025-05-24 01:12:58 -04:00
fix(mobile): exif not updated on sync (#17633)
Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
5bceefce75
commit
78f8e23834
@ -18,9 +18,9 @@ import 'package:immich_mobile/interfaces/album_media.interface.dart';
|
||||
import 'package:immich_mobile/interfaces/asset.interface.dart';
|
||||
import 'package:immich_mobile/interfaces/etag.interface.dart';
|
||||
import 'package:immich_mobile/interfaces/local_files_manager.interface.dart';
|
||||
import 'package:immich_mobile/providers/app_settings.provider.dart';
|
||||
import 'package:immich_mobile/interfaces/partner.interface.dart';
|
||||
import 'package:immich_mobile/interfaces/partner_api.interface.dart';
|
||||
import 'package:immich_mobile/providers/app_settings.provider.dart';
|
||||
import 'package:immich_mobile/providers/infrastructure/exif.provider.dart';
|
||||
import 'package:immich_mobile/providers/infrastructure/user.provider.dart';
|
||||
import 'package:immich_mobile/repositories/album.repository.dart';
|
||||
@ -29,9 +29,9 @@ import 'package:immich_mobile/repositories/album_media.repository.dart';
|
||||
import 'package:immich_mobile/repositories/asset.repository.dart';
|
||||
import 'package:immich_mobile/repositories/etag.repository.dart';
|
||||
import 'package:immich_mobile/repositories/local_files_manager.repository.dart';
|
||||
import 'package:immich_mobile/services/app_settings.service.dart';
|
||||
import 'package:immich_mobile/repositories/partner.repository.dart';
|
||||
import 'package:immich_mobile/repositories/partner_api.repository.dart';
|
||||
import 'package:immich_mobile/services/app_settings.service.dart';
|
||||
import 'package:immich_mobile/services/entity.service.dart';
|
||||
import 'package:immich_mobile/services/hash.service.dart';
|
||||
import 'package:immich_mobile/utils/async_mutex.dart';
|
||||
@ -839,13 +839,13 @@ class SyncService {
|
||||
_toggleTrashStatusForAssets(assets);
|
||||
}
|
||||
|
||||
final exifInfos = assets.map((e) => e.exifInfo).nonNulls.toList();
|
||||
try {
|
||||
await _assetRepository.transaction(() async {
|
||||
await _assetRepository.updateAll(assets);
|
||||
for (final Asset added in assets) {
|
||||
added.exifInfo = added.exifInfo?.copyWith(assetId: added.id);
|
||||
}
|
||||
final exifInfos = assets.map((e) => e.exifInfo).nonNulls.toList();
|
||||
await _exifInfoRepository.updateAll(exifInfos);
|
||||
});
|
||||
_log.info("Upserted ${assets.length} assets into the DB");
|
||||
|
@ -274,6 +274,15 @@ void main() {
|
||||
List.filled(assets.length, null),
|
||||
);
|
||||
await s.upsertAssetsWithExif(assets);
|
||||
verify(
|
||||
() => exifInfoRepository.updateAll(
|
||||
any(
|
||||
that: containsAll(
|
||||
assets.map((a) => a.exifInfo!.copyWith(assetId: a.id)),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
expect(assets.map((a) => a.exifInfo?.assetId), assets.map((a) => a.id));
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user