2022-05-06 12:22:23 +00:00
|
|
|
import 'dart:typed_data';
|
|
|
|
|
2024-09-18 15:15:52 +00:00
|
|
|
import 'package:immich_mobile/entities/album.entity.dart';
|
2022-05-06 12:22:23 +00:00
|
|
|
|
|
|
|
class AvailableAlbum {
|
2024-09-18 15:15:52 +00:00
|
|
|
final Album album;
|
|
|
|
final int assetCount;
|
2022-08-18 14:41:59 +00:00
|
|
|
final DateTime? lastBackup;
|
2022-05-06 12:22:23 +00:00
|
|
|
AvailableAlbum({
|
2024-09-18 15:15:52 +00:00
|
|
|
required this.album,
|
|
|
|
required this.assetCount,
|
2022-08-18 14:41:59 +00:00
|
|
|
this.lastBackup,
|
2022-05-06 12:22:23 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
AvailableAlbum copyWith({
|
2024-09-18 15:15:52 +00:00
|
|
|
Album? album,
|
|
|
|
int? assetCount,
|
2022-08-18 14:41:59 +00:00
|
|
|
DateTime? lastBackup,
|
2022-05-06 12:22:23 +00:00
|
|
|
Uint8List? thumbnailData,
|
|
|
|
}) {
|
|
|
|
return AvailableAlbum(
|
2024-09-18 15:15:52 +00:00
|
|
|
album: album ?? this.album,
|
|
|
|
assetCount: assetCount ?? this.assetCount,
|
2022-08-18 14:41:59 +00:00
|
|
|
lastBackup: lastBackup ?? this.lastBackup,
|
2022-05-06 12:22:23 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2024-09-18 15:15:52 +00:00
|
|
|
String get name => album.name;
|
2022-08-18 14:41:59 +00:00
|
|
|
|
2024-09-18 15:15:52 +00:00
|
|
|
String get id => album.localId!;
|
2022-08-18 14:41:59 +00:00
|
|
|
|
2024-09-18 15:15:52 +00:00
|
|
|
bool get isAll => album.isAll;
|
2022-08-18 14:41:59 +00:00
|
|
|
|
2022-05-06 12:22:23 +00:00
|
|
|
@override
|
2022-06-25 20:12:47 +00:00
|
|
|
String toString() =>
|
2024-09-18 15:15:52 +00:00
|
|
|
'AvailableAlbum(albumEntity: $album, lastBackup: $lastBackup)';
|
2022-05-06 12:22:23 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
bool operator ==(Object other) {
|
|
|
|
if (identical(this, other)) return true;
|
|
|
|
|
2024-09-18 15:15:52 +00:00
|
|
|
return other is AvailableAlbum && other.album == album;
|
2022-05-06 12:22:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
2024-09-18 15:15:52 +00:00
|
|
|
int get hashCode => album.hashCode;
|
2022-05-06 12:22:23 +00:00
|
|
|
}
|