diff --git a/mobile/lib/modules/home/ui/asset_grid/immich_asset_grid_view.dart b/mobile/lib/modules/home/ui/asset_grid/immich_asset_grid_view.dart index 30a7de6691..fb7c9ddc0f 100644 --- a/mobile/lib/modules/home/ui/asset_grid/immich_asset_grid_view.dart +++ b/mobile/lib/modules/home/ui/asset_grid/immich_asset_grid_view.dart @@ -311,7 +311,13 @@ class ImmichAssetGridViewState extends State { Widget _buildAssetGrid() { final useDragScrolling = widget.renderList.totalAssets >= 20; - void dragScrolling(bool active) => _scrolling = active; + void dragScrolling(bool active) { + if (active != _scrolling) { + setState(() { + _scrolling = active; + }); + } + } final listWidget = ScrollablePositionedList.builder( padding: const EdgeInsets.only( diff --git a/mobile/openapi/lib/model/admin_signup_response_dto.dart b/mobile/openapi/lib/model/admin_signup_response_dto.dart index 70162665a3..6eabcd7c36 100644 --- a/mobile/openapi/lib/model/admin_signup_response_dto.dart +++ b/mobile/openapi/lib/model/admin_signup_response_dto.dart @@ -72,7 +72,7 @@ class AdminSignupResponseDto { email: mapValueOfType(json, r'email')!, firstName: mapValueOfType(json, r'firstName')!, lastName: mapValueOfType(json, r'lastName')!, - createdAt: mapDateTime(json, r'createdAt', '')!, + createdAt: mapDateTime(json, r'createdAt', r'')!, ); } return null; diff --git a/mobile/openapi/lib/model/album_response_dto.dart b/mobile/openapi/lib/model/album_response_dto.dart index 3c2df247a4..dc76a67054 100644 --- a/mobile/openapi/lib/model/album_response_dto.dart +++ b/mobile/openapi/lib/model/album_response_dto.dart @@ -128,14 +128,14 @@ class AlbumResponseDto { id: mapValueOfType(json, r'id')!, ownerId: mapValueOfType(json, r'ownerId')!, albumName: mapValueOfType(json, r'albumName')!, - createdAt: mapDateTime(json, r'createdAt', '')!, - updatedAt: mapDateTime(json, r'updatedAt', '')!, + createdAt: mapDateTime(json, r'createdAt', r'')!, + updatedAt: mapDateTime(json, r'updatedAt', r'')!, albumThumbnailAssetId: mapValueOfType(json, r'albumThumbnailAssetId'), shared: mapValueOfType(json, r'shared')!, sharedUsers: UserResponseDto.listFromJson(json[r'sharedUsers']), assets: AssetResponseDto.listFromJson(json[r'assets']), owner: UserResponseDto.fromJson(json[r'owner'])!, - lastModifiedAssetTimestamp: mapDateTime(json, r'lastModifiedAssetTimestamp', ''), + lastModifiedAssetTimestamp: mapDateTime(json, r'lastModifiedAssetTimestamp', r''), ); } return null; diff --git a/mobile/openapi/lib/model/api_key_response_dto.dart b/mobile/openapi/lib/model/api_key_response_dto.dart index 2125d92c23..5aa143414d 100644 --- a/mobile/openapi/lib/model/api_key_response_dto.dart +++ b/mobile/openapi/lib/model/api_key_response_dto.dart @@ -64,8 +64,8 @@ class APIKeyResponseDto { return APIKeyResponseDto( id: mapValueOfType(json, r'id')!, name: mapValueOfType(json, r'name')!, - createdAt: mapDateTime(json, r'createdAt', '')!, - updatedAt: mapDateTime(json, r'updatedAt', '')!, + createdAt: mapDateTime(json, r'createdAt', r'')!, + updatedAt: mapDateTime(json, r'updatedAt', r'')!, ); } return null; diff --git a/mobile/openapi/lib/model/asset_response_dto.dart b/mobile/openapi/lib/model/asset_response_dto.dart index c068b61ebe..cd74d57214 100644 --- a/mobile/openapi/lib/model/asset_response_dto.dart +++ b/mobile/openapi/lib/model/asset_response_dto.dart @@ -213,9 +213,9 @@ class AssetResponseDto { originalFileName: mapValueOfType(json, r'originalFileName')!, resized: mapValueOfType(json, r'resized')!, thumbhash: mapValueOfType(json, r'thumbhash'), - fileCreatedAt: mapDateTime(json, r'fileCreatedAt', '')!, - fileModifiedAt: mapDateTime(json, r'fileModifiedAt', '')!, - updatedAt: mapDateTime(json, r'updatedAt', '')!, + fileCreatedAt: mapDateTime(json, r'fileCreatedAt', r'')!, + fileModifiedAt: mapDateTime(json, r'fileModifiedAt', r'')!, + updatedAt: mapDateTime(json, r'updatedAt', r'')!, isFavorite: mapValueOfType(json, r'isFavorite')!, isArchived: mapValueOfType(json, r'isArchived')!, mimeType: mapValueOfType(json, r'mimeType'), diff --git a/mobile/openapi/lib/model/exif_response_dto.dart b/mobile/openapi/lib/model/exif_response_dto.dart index 201c13d6e6..8af6e8f09b 100644 --- a/mobile/openapi/lib/model/exif_response_dto.dart +++ b/mobile/openapi/lib/model/exif_response_dto.dart @@ -243,31 +243,31 @@ class ExifResponseDto { model: mapValueOfType(json, r'model'), exifImageWidth: json[r'exifImageWidth'] == null ? null - : num.parse(json[r'exifImageWidth'].toString()), + : num.parse('${json[r'exifImageWidth']}'), exifImageHeight: json[r'exifImageHeight'] == null ? null - : num.parse(json[r'exifImageHeight'].toString()), + : num.parse('${json[r'exifImageHeight']}'), orientation: mapValueOfType(json, r'orientation'), - dateTimeOriginal: mapDateTime(json, r'dateTimeOriginal', ''), - modifyDate: mapDateTime(json, r'modifyDate', ''), + dateTimeOriginal: mapDateTime(json, r'dateTimeOriginal', r''), + modifyDate: mapDateTime(json, r'modifyDate', r''), timeZone: mapValueOfType(json, r'timeZone'), lensModel: mapValueOfType(json, r'lensModel'), fNumber: json[r'fNumber'] == null ? null - : num.parse(json[r'fNumber'].toString()), + : num.parse('${json[r'fNumber']}'), focalLength: json[r'focalLength'] == null ? null - : num.parse(json[r'focalLength'].toString()), + : num.parse('${json[r'focalLength']}'), iso: json[r'iso'] == null ? null - : num.parse(json[r'iso'].toString()), + : num.parse('${json[r'iso']}'), exposureTime: mapValueOfType(json, r'exposureTime'), latitude: json[r'latitude'] == null ? null - : num.parse(json[r'latitude'].toString()), + : num.parse('${json[r'latitude']}'), longitude: json[r'longitude'] == null ? null - : num.parse(json[r'longitude'].toString()), + : num.parse('${json[r'longitude']}'), city: mapValueOfType(json, r'city'), state: mapValueOfType(json, r'state'), country: mapValueOfType(json, r'country'), diff --git a/mobile/openapi/lib/model/import_asset_dto.dart b/mobile/openapi/lib/model/import_asset_dto.dart index 9a6994a106..dd67e89fb6 100644 --- a/mobile/openapi/lib/model/import_asset_dto.dart +++ b/mobile/openapi/lib/model/import_asset_dto.dart @@ -156,8 +156,8 @@ class ImportAssetDto { sidecarPath: mapValueOfType(json, r'sidecarPath'), deviceAssetId: mapValueOfType(json, r'deviceAssetId')!, deviceId: mapValueOfType(json, r'deviceId')!, - fileCreatedAt: mapDateTime(json, r'fileCreatedAt', '')!, - fileModifiedAt: mapDateTime(json, r'fileModifiedAt', '')!, + fileCreatedAt: mapDateTime(json, r'fileCreatedAt', r'')!, + fileModifiedAt: mapDateTime(json, r'fileModifiedAt', r'')!, isFavorite: mapValueOfType(json, r'isFavorite')!, isArchived: mapValueOfType(json, r'isArchived'), isVisible: mapValueOfType(json, r'isVisible'), diff --git a/mobile/openapi/lib/model/shared_link_create_dto.dart b/mobile/openapi/lib/model/shared_link_create_dto.dart index cdd481c84b..8c699424dd 100644 --- a/mobile/openapi/lib/model/shared_link_create_dto.dart +++ b/mobile/openapi/lib/model/shared_link_create_dto.dart @@ -116,7 +116,7 @@ class SharedLinkCreateDto { : const [], albumId: mapValueOfType(json, r'albumId'), description: mapValueOfType(json, r'description'), - expiresAt: mapDateTime(json, r'expiresAt', ''), + expiresAt: mapDateTime(json, r'expiresAt', r''), allowUpload: mapValueOfType(json, r'allowUpload') ?? false, allowDownload: mapValueOfType(json, r'allowDownload') ?? true, showExif: mapValueOfType(json, r'showExif') ?? true, diff --git a/mobile/openapi/lib/model/shared_link_edit_dto.dart b/mobile/openapi/lib/model/shared_link_edit_dto.dart index a427b60ef0..d5693058c6 100644 --- a/mobile/openapi/lib/model/shared_link_edit_dto.dart +++ b/mobile/openapi/lib/model/shared_link_edit_dto.dart @@ -113,7 +113,7 @@ class SharedLinkEditDto { return SharedLinkEditDto( description: mapValueOfType(json, r'description'), - expiresAt: mapDateTime(json, r'expiresAt', ''), + expiresAt: mapDateTime(json, r'expiresAt', r''), allowUpload: mapValueOfType(json, r'allowUpload'), allowDownload: mapValueOfType(json, r'allowDownload'), showExif: mapValueOfType(json, r'showExif'), diff --git a/mobile/openapi/lib/model/shared_link_response_dto.dart b/mobile/openapi/lib/model/shared_link_response_dto.dart index fad2b4383d..9e40fd29a6 100644 --- a/mobile/openapi/lib/model/shared_link_response_dto.dart +++ b/mobile/openapi/lib/model/shared_link_response_dto.dart @@ -133,8 +133,8 @@ class SharedLinkResponseDto { description: mapValueOfType(json, r'description'), userId: mapValueOfType(json, r'userId')!, key: mapValueOfType(json, r'key')!, - createdAt: mapDateTime(json, r'createdAt', '')!, - expiresAt: mapDateTime(json, r'expiresAt', ''), + createdAt: mapDateTime(json, r'createdAt', r'')!, + expiresAt: mapDateTime(json, r'expiresAt', r''), assets: AssetResponseDto.listFromJson(json[r'assets']), album: AlbumResponseDto.fromJson(json[r'album']), allowUpload: mapValueOfType(json, r'allowUpload')!, diff --git a/mobile/openapi/lib/model/user_response_dto.dart b/mobile/openapi/lib/model/user_response_dto.dart index dcf7e928b5..29fd788f53 100644 --- a/mobile/openapi/lib/model/user_response_dto.dart +++ b/mobile/openapi/lib/model/user_response_dto.dart @@ -137,9 +137,9 @@ class UserResponseDto { profileImagePath: mapValueOfType(json, r'profileImagePath')!, shouldChangePassword: mapValueOfType(json, r'shouldChangePassword')!, isAdmin: mapValueOfType(json, r'isAdmin')!, - createdAt: mapDateTime(json, r'createdAt', '')!, - deletedAt: mapDateTime(json, r'deletedAt', ''), - updatedAt: mapDateTime(json, r'updatedAt', '')!, + createdAt: mapDateTime(json, r'createdAt', r'')!, + deletedAt: mapDateTime(json, r'deletedAt', r''), + updatedAt: mapDateTime(json, r'updatedAt', r'')!, oauthId: mapValueOfType(json, r'oauthId')!, ); } diff --git a/server/openapi-generator/templates/mobile/serialization/native/native_class.mustache b/server/openapi-generator/templates/mobile/serialization/native/native_class.mustache index c6a96f29e0..c66528c3f5 100644 --- a/server/openapi-generator/templates/mobile/serialization/native/native_class.mustache +++ b/server/openapi-generator/templates/mobile/serialization/native/native_class.mustache @@ -66,7 +66,7 @@ class {{{classname}}} { {{/isNullable}} {{#isDateTime}} {{#pattern}} - json[r'{{{baseName}}}'] = _dateEpochMarker == '{{{pattern}}}' + json[r'{{{baseName}}}'] = _isEpochMarker(r'{{{pattern}}}') ? this.{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.millisecondsSinceEpoch : this.{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc().toIso8601String(); {{/pattern}} @@ -76,7 +76,7 @@ class {{{classname}}} { {{/isDateTime}} {{#isDate}} {{#pattern}} - json[r'{{{baseName}}}'] = _dateEpochMarker == '{{{pattern}}}' + json[r'{{{baseName}}}'] = _isEpochMarker(r'{{{pattern}}}') ? this.{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.millisecondsSinceEpoch : _dateFormatter.format(this.{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc()); {{/pattern}} @@ -117,10 +117,10 @@ class {{{classname}}} { return {{{classname}}}( {{#vars}} {{#isDateTime}} - {{{name}}}: mapDateTime(json, r'{{{baseName}}}', '{{{pattern}}}'){{#required}}{{^isNullable}}!{{/isNullable}}{{/required}}{{^required}}{{#defaultValue}} ?? {{{.}}}{{/defaultValue}}{{/required}}, + {{{name}}}: mapDateTime(json, r'{{{baseName}}}', r'{{{pattern}}}'){{#required}}{{^isNullable}}!{{/isNullable}}{{/required}}{{^required}}{{#defaultValue}} ?? {{{.}}}{{/defaultValue}}{{/required}}, {{/isDateTime}} {{#isDate}} - {{{name}}}: mapDateTime(json, r'{{{baseName}}}', '{{{pattern}}}'){{#required}}{{^isNullable}}!{{/isNullable}}{{/required}}{{^required}}{{#defaultValue}} ?? {{{.}}}{{/defaultValue}}{{/required}}, + {{{name}}}: mapDateTime(json, r'{{{baseName}}}', r'{{{pattern}}}'){{#required}}{{^isNullable}}!{{/isNullable}}{{/required}}{{^required}}{{#defaultValue}} ?? {{{.}}}{{/defaultValue}}{{/required}}, {{/isDate}} {{^isDateTime}} {{^isDate}} @@ -200,9 +200,9 @@ class {{{classname}}} { {{/isMap}} {{^isMap}} {{#isNumber}} - {{{name}}}: json[r'{{{baseName}}}'] == null + {{{name}}}: {{#isNullable}}json[r'{{{baseName}}}'] == null ? {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}} - : {{{datatypeWithEnum}}}.parse(json[r'{{{baseName}}}'].toString()), + : {{/isNullable}}{{{datatypeWithEnum}}}.parse('${json[r'{{{baseName}}}']}'), {{/isNumber}} {{^isNumber}} {{^isEnum}}