Piwigo / piwigo-flutter-app

Piwigo mobile application for Android
GNU General Public License v2.0
82 stars 26 forks source link

Change ImageModel.name to nullable string #171

Closed prookyon closed 6 months ago

prookyon commented 11 months ago

Currently if image name does not exist it is fetched in Json as null and this results in a very ugly name "null" displayed for those photos.

This PR changes ImageModel.name to nullable string (as it most certainly can be null coming from Piwigo web API). Name is null-coalesced to empty string where used.

Alternatively of course it would be possible to just null-coalesce to empty string in ImageModel.fromJson() which would require no other modifications but this seems less elegant as it would hide the fact that non-existent name is possible and would differ from current handling of other nullable members in ImageModel.