mirror of
https://github.com/immich-app/immich.git
synced 2025-12-21 01:11:16 +03:00
feat: sync cloudId and eTag on sync
This commit is contained in:
@@ -390,4 +390,20 @@ class NativeSyncApiImpl: ImmichPlugin, NativeSyncApi, FlutterPlugin {
|
||||
return PHAsset.fetchAssets(in: album, options: options)
|
||||
}
|
||||
}
|
||||
|
||||
func getCloudIdForAssetIds(assetIds: [String]) throws -> [String : String?] {
|
||||
guard #available(iOS 16, *) else {
|
||||
return Dictionary(
|
||||
uniqueKeysWithValues: assetIds.map { ($0, nil as String?) }
|
||||
)
|
||||
}
|
||||
|
||||
var mappings: [String: String?] = [:]
|
||||
let result = PHPhotoLibrary.shared().cloudIdentifierMappings(forLocalIdentifiers: assetIds)
|
||||
for (key, value) in result {
|
||||
let id = try? value.get().stringValue
|
||||
mappings[key] = id
|
||||
}
|
||||
return mappings;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user