feat: batch change date and time relatively (#17717)

Co-authored-by: marcel.kuehne <>
Co-authored-by: Zack Pollard <zackpollard@ymail.com>
This commit is contained in:
mkuehne707 2025-08-07 15:42:33 +02:00 committed by GitHub
parent df2525ee08
commit 011a667314
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 574 additions and 52 deletions

View file

@ -14,6 +14,7 @@ class AssetBulkUpdateDto {
/// Returns a new [AssetBulkUpdateDto] instance.
AssetBulkUpdateDto({
this.dateTimeOriginal,
this.dateTimeRelative,
this.description,
this.duplicateId,
this.ids = const [],
@ -21,6 +22,7 @@ class AssetBulkUpdateDto {
this.latitude,
this.longitude,
this.rating,
this.timeZone,
this.visibility,
});
@ -32,6 +34,14 @@ class AssetBulkUpdateDto {
///
String? dateTimeOriginal;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
num? dateTimeRelative;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
@ -78,6 +88,14 @@ class AssetBulkUpdateDto {
///
num? rating;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? timeZone;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
@ -89,6 +107,7 @@ class AssetBulkUpdateDto {
@override
bool operator ==(Object other) => identical(this, other) || other is AssetBulkUpdateDto &&
other.dateTimeOriginal == dateTimeOriginal &&
other.dateTimeRelative == dateTimeRelative &&
other.description == description &&
other.duplicateId == duplicateId &&
_deepEquality.equals(other.ids, ids) &&
@ -96,12 +115,14 @@ class AssetBulkUpdateDto {
other.latitude == latitude &&
other.longitude == longitude &&
other.rating == rating &&
other.timeZone == timeZone &&
other.visibility == visibility;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(dateTimeOriginal == null ? 0 : dateTimeOriginal!.hashCode) +
(dateTimeRelative == null ? 0 : dateTimeRelative!.hashCode) +
(description == null ? 0 : description!.hashCode) +
(duplicateId == null ? 0 : duplicateId!.hashCode) +
(ids.hashCode) +
@ -109,10 +130,11 @@ class AssetBulkUpdateDto {
(latitude == null ? 0 : latitude!.hashCode) +
(longitude == null ? 0 : longitude!.hashCode) +
(rating == null ? 0 : rating!.hashCode) +
(timeZone == null ? 0 : timeZone!.hashCode) +
(visibility == null ? 0 : visibility!.hashCode);
@override
String toString() => 'AssetBulkUpdateDto[dateTimeOriginal=$dateTimeOriginal, description=$description, duplicateId=$duplicateId, ids=$ids, isFavorite=$isFavorite, latitude=$latitude, longitude=$longitude, rating=$rating, visibility=$visibility]';
String toString() => 'AssetBulkUpdateDto[dateTimeOriginal=$dateTimeOriginal, dateTimeRelative=$dateTimeRelative, description=$description, duplicateId=$duplicateId, ids=$ids, isFavorite=$isFavorite, latitude=$latitude, longitude=$longitude, rating=$rating, timeZone=$timeZone, visibility=$visibility]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@ -121,6 +143,11 @@ class AssetBulkUpdateDto {
} else {
// json[r'dateTimeOriginal'] = null;
}
if (this.dateTimeRelative != null) {
json[r'dateTimeRelative'] = this.dateTimeRelative;
} else {
// json[r'dateTimeRelative'] = null;
}
if (this.description != null) {
json[r'description'] = this.description;
} else {
@ -152,6 +179,11 @@ class AssetBulkUpdateDto {
} else {
// json[r'rating'] = null;
}
if (this.timeZone != null) {
json[r'timeZone'] = this.timeZone;
} else {
// json[r'timeZone'] = null;
}
if (this.visibility != null) {
json[r'visibility'] = this.visibility;
} else {
@ -170,6 +202,7 @@ class AssetBulkUpdateDto {
return AssetBulkUpdateDto(
dateTimeOriginal: mapValueOfType<String>(json, r'dateTimeOriginal'),
dateTimeRelative: num.parse('${json[r'dateTimeRelative']}'),
description: mapValueOfType<String>(json, r'description'),
duplicateId: mapValueOfType<String>(json, r'duplicateId'),
ids: json[r'ids'] is Iterable
@ -179,6 +212,7 @@ class AssetBulkUpdateDto {
latitude: num.parse('${json[r'latitude']}'),
longitude: num.parse('${json[r'longitude']}'),
rating: num.parse('${json[r'rating']}'),
timeZone: mapValueOfType<String>(json, r'timeZone'),
visibility: AssetVisibility.fromJson(json[r'visibility']),
);
}