mirror of
https://github.com/samsonjs/immich.git
synced 2026-04-05 11:05:53 +00: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:
parent
b8087b4fa2
commit
0647c22956
1 changed files with 10 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue