mirror of
https://github.com/immich-app/immich.git
synced 2025-12-06 09:13:13 +03:00
fix(mobile): handle empty original filename (#23469)
* Handle empty original filename * Handle TypeError from photo_manager titleAsync * More compact exception log
This commit is contained in:
@@ -89,9 +89,16 @@ class AssetMediaRepository {
|
||||
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;
|
||||
try {
|
||||
// titleAsync gets the correct original filename for some assets on iOS
|
||||
// otherwise using the `entity.title` would return a random GUID
|
||||
final originalFilename = await entity.titleAsync;
|
||||
// treat empty filename as missing
|
||||
return originalFilename.isNotEmpty ? originalFilename : null;
|
||||
} catch (e) {
|
||||
_log.warning("Failed to get original filename for asset: $id. Error: $e");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: make this more efficient
|
||||
|
||||
Reference in New Issue
Block a user