You've already forked immich
mirror of
https://github.com/immich-app/immich.git
synced 2025-06-17 03:47:45 +02:00
refactor(mobile): reworked Asset, store all required fields from local & remote (#1539)
replace usage of AssetResponseDto with Asset Add new class ExifInfo to store data from ExifResponseDto
This commit is contained in:
committed by
GitHub
parent
7bd2455175
commit
0048662182
@ -1,76 +0,0 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
class ImmichAssetGroupByDate {
|
||||
final String date;
|
||||
List<AssetResponseDto> assets;
|
||||
ImmichAssetGroupByDate({
|
||||
required this.date,
|
||||
required this.assets,
|
||||
});
|
||||
|
||||
ImmichAssetGroupByDate copyWith({
|
||||
String? date,
|
||||
List<AssetResponseDto>? assets,
|
||||
}) {
|
||||
return ImmichAssetGroupByDate(
|
||||
date: date ?? this.date,
|
||||
assets: assets ?? this.assets,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() => 'ImmichAssetGroupByDate(date: $date, assets: $assets)';
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) return true;
|
||||
|
||||
return other is ImmichAssetGroupByDate &&
|
||||
other.date == date &&
|
||||
listEquals(other.assets, assets);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => date.hashCode ^ assets.hashCode;
|
||||
}
|
||||
|
||||
class GetAllAssetResponse {
|
||||
final int count;
|
||||
final List<ImmichAssetGroupByDate> data;
|
||||
final String nextPageKey;
|
||||
GetAllAssetResponse({
|
||||
required this.count,
|
||||
required this.data,
|
||||
required this.nextPageKey,
|
||||
});
|
||||
|
||||
GetAllAssetResponse copyWith({
|
||||
int? count,
|
||||
List<ImmichAssetGroupByDate>? data,
|
||||
String? nextPageKey,
|
||||
}) {
|
||||
return GetAllAssetResponse(
|
||||
count: count ?? this.count,
|
||||
data: data ?? this.data,
|
||||
nextPageKey: nextPageKey ?? this.nextPageKey,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() =>
|
||||
'GetAllAssetResponse(count: $count, data: $data, nextPageKey: $nextPageKey)';
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) return true;
|
||||
|
||||
return other is GetAllAssetResponse &&
|
||||
other.count == count &&
|
||||
listEquals(other.data, data) &&
|
||||
other.nextPageKey == nextPageKey;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => count.hashCode ^ data.hashCode ^ nextPageKey.hashCode;
|
||||
}
|
Reference in New Issue
Block a user