fix(mobile): incorrect filename is retrieved during upload (#12990)

* fix(mobile): incorrect filename is retrieve during upload

* use the same convention to get local id

* revert previous change

* pr feedback
This commit is contained in:
Alex
2024-09-27 22:28:31 +07:00
committed by GitHub
parent 3a37fc8bfd
commit 03aa346020
4 changed files with 27 additions and 1 deletions
@@ -43,4 +43,17 @@ class AssetMediaRepository implements IAssetMediaRepository {
asset.local = local;
return asset;
}
@override
Future<String?> getOriginalFilename(String id) async {
final entity = await AssetEntity.fromId(id);
if (entity == null) {
return null;
}
// titleAsync gets the correct original filename for some assets on iOS
// otherwise using the `entity.title` would return a random GUID
return await entity.titleAsync;
}
}