mirror of
https://github.com/samsonjs/immich.git
synced 2026-04-27 15:07:45 +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;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// titleAsync gets the correct original filename for some assets on iOS
|
try {
|
||||||
// otherwise using the `entity.title` would return a random GUID
|
// titleAsync gets the correct original filename for some assets on iOS
|
||||||
return await entity.titleAsync;
|
// 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
|
// TODO: make this more efficient
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue