mirror of
https://github.com/immich-app/immich.git
synced 2025-07-31 15:08:44 -04:00
chore: bump line length to 120 (#20191)
This commit is contained in:
parent
977c9b96ba
commit
ad65e9011a
3
.github/workflows/static_analysis.yml
vendored
3
.github/workflows/static_analysis.yml
vendored
@ -98,7 +98,8 @@ jobs:
|
|||||||
run: dart analyze --fatal-infos
|
run: dart analyze --fatal-infos
|
||||||
|
|
||||||
- name: Run dart format
|
- name: Run dart format
|
||||||
run: dart format lib/ --set-exit-if-changed
|
# Ignore generated files manually until https://github.com/dart-lang/dart_style/issues/864 is resolved
|
||||||
|
run: dart format --set-exit-if-changed $(find lib -name '*.dart' -not \( -name 'generated_plugin_registrant.dart' -o -name '*.g.dart' -o -name '*.drift.dart' \))
|
||||||
|
|
||||||
- name: Run dart custom_lint
|
- name: Run dart custom_lint
|
||||||
run: dart run custom_lint
|
run: dart run custom_lint
|
||||||
|
4
mobile/.vscode/settings.json
vendored
4
mobile/.vscode/settings.json
vendored
@ -1,5 +1,9 @@
|
|||||||
{
|
{
|
||||||
"dart.flutterSdkPath": ".fvm/versions/3.32.6",
|
"dart.flutterSdkPath": ".fvm/versions/3.32.6",
|
||||||
|
"dart.lineLength": 120,
|
||||||
|
"[dart]": {
|
||||||
|
"editor.rulers": [120],
|
||||||
|
},
|
||||||
"search.exclude": {
|
"search.exclude": {
|
||||||
"**/.fvm": true
|
"**/.fvm": true
|
||||||
},
|
},
|
||||||
|
@ -9,6 +9,9 @@
|
|||||||
# packages, and plugins designed to encourage good coding practices.
|
# packages, and plugins designed to encourage good coding practices.
|
||||||
include: package:flutter_lints/flutter.yaml
|
include: package:flutter_lints/flutter.yaml
|
||||||
|
|
||||||
|
formatter:
|
||||||
|
page_width: 120
|
||||||
|
|
||||||
linter:
|
linter:
|
||||||
# The lint rules applied to this project can be customized in the
|
# The lint rules applied to this project can be customized in the
|
||||||
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
|
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
|
||||||
|
@ -10,7 +10,7 @@ enum ImmichColorPreset {
|
|||||||
lime,
|
lime,
|
||||||
green,
|
green,
|
||||||
cyan,
|
cyan,
|
||||||
slateGray
|
slateGray,
|
||||||
}
|
}
|
||||||
|
|
||||||
const ImmichColorPreset defaultColorPreset = ImmichColorPreset.indigo;
|
const ImmichColorPreset defaultColorPreset = ImmichColorPreset.indigo;
|
||||||
|
@ -7,10 +7,8 @@ const Map<String, Locale> locales = {
|
|||||||
'Arabic (ar)': Locale('ar'),
|
'Arabic (ar)': Locale('ar'),
|
||||||
'Bulgarian (bg)': Locale('bg'),
|
'Bulgarian (bg)': Locale('bg'),
|
||||||
'Catalan (ca)': Locale('ca'),
|
'Catalan (ca)': Locale('ca'),
|
||||||
'Chinese Simplified (zh_CN)':
|
'Chinese Simplified (zh_CN)': Locale.fromSubtags(languageCode: 'zh', scriptCode: 'SIMPLIFIED'),
|
||||||
Locale.fromSubtags(languageCode: 'zh', scriptCode: 'SIMPLIFIED'),
|
'Chinese Traditional (zh_TW)': Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hant'),
|
||||||
'Chinese Traditional (zh_TW)':
|
|
||||||
Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hant'),
|
|
||||||
'Croatian (hr)': Locale('hr'),
|
'Croatian (hr)': Locale('hr'),
|
||||||
'Czech (cs)': Locale('cs'),
|
'Czech (cs)': Locale('cs'),
|
||||||
'Danish (da)': Locale('da'),
|
'Danish (da)': Locale('da'),
|
||||||
@ -37,10 +35,8 @@ const Map<String, Locale> locales = {
|
|||||||
'Portuguese (pt)': Locale('pt'),
|
'Portuguese (pt)': Locale('pt'),
|
||||||
'Romanian (ro)': Locale('ro'),
|
'Romanian (ro)': Locale('ro'),
|
||||||
'Russian (ru)': Locale('ru'),
|
'Russian (ru)': Locale('ru'),
|
||||||
'Serbian Cyrillic (sr_Cyrl)':
|
'Serbian Cyrillic (sr_Cyrl)': Locale.fromSubtags(languageCode: 'sr', scriptCode: 'Cyrl'),
|
||||||
Locale.fromSubtags(languageCode: 'sr', scriptCode: 'Cyrl'),
|
'Serbian Latin (sr_Latn)': Locale.fromSubtags(languageCode: 'sr', scriptCode: 'Latn'),
|
||||||
'Serbian Latin (sr_Latn)':
|
|
||||||
Locale.fromSubtags(languageCode: 'sr', scriptCode: 'Latn'),
|
|
||||||
'Slovak (sk)': Locale('sk'),
|
'Slovak (sk)': Locale('sk'),
|
||||||
'Slovenian (sl)': Locale('sl'),
|
'Slovenian (sl)': Locale('sl'),
|
||||||
'Spanish (es)': Locale('es'),
|
'Spanish (es)': Locale('es'),
|
||||||
|
@ -53,10 +53,8 @@ sealed class BaseAsset {
|
|||||||
return const Duration();
|
return const Duration();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get hasRemote =>
|
bool get hasRemote => storage == AssetState.remote || storage == AssetState.merged;
|
||||||
storage == AssetState.remote || storage == AssetState.merged;
|
bool get hasLocal => storage == AssetState.local || storage == AssetState.merged;
|
||||||
bool get hasLocal =>
|
|
||||||
storage == AssetState.local || storage == AssetState.merged;
|
|
||||||
bool get isLocalOnly => storage == AssetState.local;
|
bool get isLocalOnly => storage == AssetState.local;
|
||||||
bool get isRemoteOnly => storage == AssetState.remote;
|
bool get isRemoteOnly => storage == AssetState.remote;
|
||||||
|
|
||||||
|
@ -22,8 +22,7 @@ class LocalAsset extends BaseAsset {
|
|||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
AssetState get storage =>
|
AssetState get storage => remoteId == null ? AssetState.local : AssetState.merged;
|
||||||
remoteId == null ? AssetState.local : AssetState.merged;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get heroTag => '${id}_${remoteId ?? checksum}';
|
String get heroTag => '${id}_${remoteId ?? checksum}';
|
||||||
@ -54,8 +53,7 @@ class LocalAsset extends BaseAsset {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode =>
|
int get hashCode => super.hashCode ^ id.hashCode ^ remoteId.hashCode ^ orientation.hashCode;
|
||||||
super.hashCode ^ id.hashCode ^ remoteId.hashCode ^ orientation.hashCode;
|
|
||||||
|
|
||||||
LocalAsset copyWith({
|
LocalAsset copyWith({
|
||||||
String? id,
|
String? id,
|
||||||
|
@ -36,8 +36,7 @@ class RemoteAsset extends BaseAsset {
|
|||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
AssetState get storage =>
|
AssetState get storage => localId == null ? AssetState.remote : AssetState.merged;
|
||||||
localId == null ? AssetState.remote : AssetState.merged;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get heroTag => '${localId ?? checksum}_$id';
|
String get heroTag => '${localId ?? checksum}_$id';
|
||||||
|
@ -15,9 +15,7 @@ class DeviceAsset {
|
|||||||
bool operator ==(covariant DeviceAsset other) {
|
bool operator ==(covariant DeviceAsset other) {
|
||||||
if (identical(this, other)) return true;
|
if (identical(this, other)) return true;
|
||||||
|
|
||||||
return other.assetId == assetId &&
|
return other.assetId == assetId && other.hash == hash && other.modifiedTime == modifiedTime;
|
||||||
other.hash == hash &&
|
|
||||||
other.modifiedTime == modifiedTime;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -25,8 +25,7 @@ class ExifInfo {
|
|||||||
final int? iso;
|
final int? iso;
|
||||||
final double? exposureSeconds;
|
final double? exposureSeconds;
|
||||||
|
|
||||||
bool get hasCoordinates =>
|
bool get hasCoordinates => latitude != null && longitude != null && latitude != 0 && longitude != 0;
|
||||||
latitude != null && longitude != null && latitude != 0 && longitude != 0;
|
|
||||||
|
|
||||||
String get exposureTime {
|
String get exposureTime {
|
||||||
if (exposureSeconds == null) {
|
if (exposureSeconds == null) {
|
||||||
|
@ -43,12 +43,7 @@ class LogMessage {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode {
|
int get hashCode {
|
||||||
return message.hashCode ^
|
return message.hashCode ^ level.hashCode ^ createdAt.hashCode ^ logger.hashCode ^ error.hashCode ^ stack.hashCode;
|
||||||
level.hashCode ^
|
|
||||||
createdAt.hashCode ^
|
|
||||||
logger.hashCode ^
|
|
||||||
error.hashCode ^
|
|
||||||
stack.hashCode;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -39,8 +39,7 @@ class MemoryData {
|
|||||||
|
|
||||||
String toJson() => json.encode(toMap());
|
String toJson() => json.encode(toMap());
|
||||||
|
|
||||||
factory MemoryData.fromJson(String source) =>
|
factory MemoryData.fromJson(String source) => MemoryData.fromMap(json.decode(source) as Map<String, dynamic>);
|
||||||
MemoryData.fromMap(json.decode(source) as Map<String, dynamic>);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() => 'MemoryData(year: $year)';
|
String toString() => 'MemoryData(year: $year)';
|
||||||
|
@ -55,22 +55,17 @@ class PersonDto {
|
|||||||
factory PersonDto.fromMap(Map<String, dynamic> map) {
|
factory PersonDto.fromMap(Map<String, dynamic> map) {
|
||||||
return PersonDto(
|
return PersonDto(
|
||||||
id: map['id'] as String,
|
id: map['id'] as String,
|
||||||
birthDate: map['birthDate'] != null
|
birthDate: map['birthDate'] != null ? DateTime.fromMillisecondsSinceEpoch(map['birthDate'] as int) : null,
|
||||||
? DateTime.fromMillisecondsSinceEpoch(map['birthDate'] as int)
|
|
||||||
: null,
|
|
||||||
isHidden: map['isHidden'] as bool,
|
isHidden: map['isHidden'] as bool,
|
||||||
name: map['name'] as String,
|
name: map['name'] as String,
|
||||||
thumbnailPath: map['thumbnailPath'] as String,
|
thumbnailPath: map['thumbnailPath'] as String,
|
||||||
updatedAt: map['updatedAt'] != null
|
updatedAt: map['updatedAt'] != null ? DateTime.fromMillisecondsSinceEpoch(map['updatedAt'] as int) : null,
|
||||||
? DateTime.fromMillisecondsSinceEpoch(map['updatedAt'] as int)
|
|
||||||
: null,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
String toJson() => json.encode(toMap());
|
String toJson() => json.encode(toMap());
|
||||||
|
|
||||||
factory PersonDto.fromJson(String source) =>
|
factory PersonDto.fromJson(String source) => PersonDto.fromMap(json.decode(source) as Map<String, dynamic>);
|
||||||
PersonDto.fromMap(json.decode(source) as Map<String, dynamic>);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(covariant PersonDto other) {
|
bool operator ==(covariant PersonDto other) {
|
||||||
|
@ -54,11 +54,7 @@ class Stack {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode {
|
int get hashCode {
|
||||||
return id.hashCode ^
|
return id.hashCode ^ createdAt.hashCode ^ updatedAt.hashCode ^ ownerId.hashCode ^ primaryAssetId.hashCode;
|
||||||
createdAt.hashCode ^
|
|
||||||
updatedAt.hashCode ^
|
|
||||||
ownerId.hashCode ^
|
|
||||||
primaryAssetId.hashCode;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,9 +73,7 @@ class StackResponse {
|
|||||||
bool operator ==(covariant StackResponse other) {
|
bool operator ==(covariant StackResponse other) {
|
||||||
if (identical(this, other)) return true;
|
if (identical(this, other)) return true;
|
||||||
|
|
||||||
return other.id == id &&
|
return other.id == id && other.primaryAssetId == primaryAssetId && other.assetIds == assetIds;
|
||||||
other.primaryAssetId == primaryAssetId &&
|
|
||||||
other.assetIds == assetIds;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -175,16 +175,13 @@ class PartnerUserDto {
|
|||||||
email: map['email'] as String,
|
email: map['email'] as String,
|
||||||
name: map['name'] as String,
|
name: map['name'] as String,
|
||||||
inTimeline: map['inTimeline'] as bool,
|
inTimeline: map['inTimeline'] as bool,
|
||||||
profileImagePath: map['profileImagePath'] != null
|
profileImagePath: map['profileImagePath'] != null ? map['profileImagePath'] as String : null,
|
||||||
? map['profileImagePath'] as String
|
|
||||||
: null,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
String toJson() => json.encode(toMap());
|
String toJson() => json.encode(toMap());
|
||||||
|
|
||||||
factory PartnerUserDto.fromJson(String source) =>
|
factory PartnerUserDto.fromJson(String source) => PartnerUserDto.fromMap(json.decode(source) as Map<String, dynamic>);
|
||||||
PartnerUserDto.fromMap(json.decode(source) as Map<String, dynamic>);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
@ -204,10 +201,6 @@ class PartnerUserDto {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode {
|
int get hashCode {
|
||||||
return id.hashCode ^
|
return id.hashCode ^ email.hashCode ^ name.hashCode ^ inTimeline.hashCode ^ profileImagePath.hashCode;
|
||||||
email.hashCode ^
|
|
||||||
name.hashCode ^
|
|
||||||
inTimeline.hashCode ^
|
|
||||||
profileImagePath.hashCode;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,8 +24,7 @@ enum AvatarColor {
|
|||||||
const AvatarColor(this.value);
|
const AvatarColor(this.value);
|
||||||
|
|
||||||
Color toColor({bool isDarkTheme = false}) => switch (this) {
|
Color toColor({bool isDarkTheme = false}) => switch (this) {
|
||||||
AvatarColor.primary =>
|
AvatarColor.primary => isDarkTheme ? const Color(0xFFABCBFA) : const Color(0xFF4250AF),
|
||||||
isDarkTheme ? const Color(0xFFABCBFA) : const Color(0xFF4250AF),
|
|
||||||
AvatarColor.pink => const Color.fromARGB(255, 244, 114, 182),
|
AvatarColor.pink => const Color.fromARGB(255, 244, 114, 182),
|
||||||
AvatarColor.red => const Color.fromARGB(255, 239, 68, 68),
|
AvatarColor.red => const Color.fromARGB(255, 239, 68, 68),
|
||||||
AvatarColor.yellow => const Color.fromARGB(255, 234, 179, 8),
|
AvatarColor.yellow => const Color.fromARGB(255, 234, 179, 8),
|
||||||
@ -241,14 +240,11 @@ licenseKey: $licenseKey,
|
|||||||
bool operator ==(covariant License other) {
|
bool operator ==(covariant License other) {
|
||||||
if (identical(this, other)) return true;
|
if (identical(this, other)) return true;
|
||||||
|
|
||||||
return activatedAt == other.activatedAt &&
|
return activatedAt == other.activatedAt && activationKey == other.activationKey && licenseKey == other.licenseKey;
|
||||||
activationKey == other.activationKey &&
|
|
||||||
licenseKey == other.licenseKey;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode =>
|
int get hashCode => activatedAt.hashCode ^ activationKey.hashCode ^ licenseKey.hashCode;
|
||||||
activatedAt.hashCode ^ activationKey.hashCode ^ licenseKey.hashCode;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Model for a user metadata stored in the server
|
// Model for a user metadata stored in the server
|
||||||
@ -310,10 +306,6 @@ license: ${license ?? "<NA>"},
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode {
|
int get hashCode {
|
||||||
return userId.hashCode ^
|
return userId.hashCode ^ key.hashCode ^ onboarding.hashCode ^ preferences.hashCode ^ license.hashCode;
|
||||||
key.hashCode ^
|
|
||||||
onboarding.hashCode ^
|
|
||||||
preferences.hashCode ^
|
|
||||||
license.hashCode;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,9 +19,7 @@ class AssetService {
|
|||||||
|
|
||||||
Stream<BaseAsset?> watchAsset(BaseAsset asset) {
|
Stream<BaseAsset?> watchAsset(BaseAsset asset) {
|
||||||
final id = asset is LocalAsset ? asset.id : (asset as RemoteAsset).id;
|
final id = asset is LocalAsset ? asset.id : (asset as RemoteAsset).id;
|
||||||
return asset is LocalAsset
|
return asset is LocalAsset ? _localAssetRepository.watchAsset(id) : _remoteAssetRepository.watchAsset(id);
|
||||||
? _localAssetRepository.watchAsset(id)
|
|
||||||
: _remoteAssetRepository.watchAsset(id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<RemoteAsset>> getStack(RemoteAsset asset) async {
|
Future<List<RemoteAsset>> getStack(RemoteAsset asset) async {
|
||||||
@ -40,8 +38,7 @@ class AssetService {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
final id =
|
final id = asset is LocalAsset ? asset.remoteId! : (asset as RemoteAsset).id;
|
||||||
asset is LocalAsset ? asset.remoteId! : (asset as RemoteAsset).id;
|
|
||||||
return _remoteAssetRepository.getExif(id);
|
return _remoteAssetRepository.getExif(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,8 +53,7 @@ class AssetService {
|
|||||||
width = exif?.width ?? asset.width?.toDouble();
|
width = exif?.width ?? asset.width?.toDouble();
|
||||||
height = exif?.height ?? asset.height?.toDouble();
|
height = exif?.height ?? asset.height?.toDouble();
|
||||||
} else if (asset is LocalAsset) {
|
} else if (asset is LocalAsset) {
|
||||||
isFlipped = _platform.isAndroid &&
|
isFlipped = _platform.isAndroid && (asset.orientation == 90 || asset.orientation == 270);
|
||||||
(asset.orientation == 90 || asset.orientation == 270);
|
|
||||||
width = asset.width?.toDouble();
|
width = asset.width?.toDouble();
|
||||||
height = asset.height?.toDouble();
|
height = asset.height?.toDouble();
|
||||||
} else {
|
} else {
|
||||||
@ -78,10 +74,7 @@ class AssetService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<(int local, int remote)> getAssetCounts() async {
|
Future<(int local, int remote)> getAssetCounts() async {
|
||||||
return (
|
return (await _localAssetRepository.getCount(), await _remoteAssetRepository.getCount());
|
||||||
await _localAssetRepository.getCount(),
|
|
||||||
await _remoteAssetRepository.getCount()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<int> getLocalHashedCount() {
|
Future<int> getLocalHashedCount() {
|
||||||
|
@ -41,8 +41,7 @@ class HashService {
|
|||||||
);
|
);
|
||||||
|
|
||||||
for (final album in localAlbums) {
|
for (final album in localAlbums) {
|
||||||
final assetsToHash =
|
final assetsToHash = await _localAlbumRepository.getAssetsToHash(album.id);
|
||||||
await _localAlbumRepository.getAssetsToHash(album.id);
|
|
||||||
if (assetsToHash.isNotEmpty) {
|
if (assetsToHash.isNotEmpty) {
|
||||||
await _hashAssets(assetsToHash);
|
await _hashAssets(assetsToHash);
|
||||||
}
|
}
|
||||||
@ -88,8 +87,7 @@ class HashService {
|
|||||||
_log.fine("Hashing ${toHash.length} files");
|
_log.fine("Hashing ${toHash.length} files");
|
||||||
|
|
||||||
final hashed = <LocalAsset>[];
|
final hashed = <LocalAsset>[];
|
||||||
final hashes =
|
final hashes = await _nativeSyncApi.hashPaths(toHash.map((e) => e.path).toList());
|
||||||
await _nativeSyncApi.hashPaths(toHash.map((e) => e.path).toList());
|
|
||||||
assert(
|
assert(
|
||||||
hashes.length == toHash.length,
|
hashes.length == toHash.length,
|
||||||
"Hashes length does not match toHash length: ${hashes.length} != ${toHash.length}",
|
"Hashes length does not match toHash length: ${hashes.length} != ${toHash.length}",
|
||||||
|
@ -66,8 +66,7 @@ class LocalSyncService {
|
|||||||
// On iOS, we need to full sync albums that are marked as cloud as the delta sync
|
// On iOS, we need to full sync albums that are marked as cloud as the delta sync
|
||||||
// does not include changes for cloud albums. If ignoreIcloudAssets is enabled,
|
// does not include changes for cloud albums. If ignoreIcloudAssets is enabled,
|
||||||
// remove the albums from the local database from the previous sync
|
// remove the albums from the local database from the previous sync
|
||||||
final cloudAlbums =
|
final cloudAlbums = deviceAlbums.where((a) => a.isCloud).toLocalAlbums();
|
||||||
deviceAlbums.where((a) => a.isCloud).toLocalAlbums();
|
|
||||||
for (final album in cloudAlbums) {
|
for (final album in cloudAlbums) {
|
||||||
final dbAlbum = dbAlbums.firstWhereOrNull((a) => a.id == album.id);
|
final dbAlbum = dbAlbums.firstWhereOrNull((a) => a.id == album.id);
|
||||||
if (dbAlbum == null) {
|
if (dbAlbum == null) {
|
||||||
@ -95,8 +94,7 @@ class LocalSyncService {
|
|||||||
final Stopwatch stopwatch = Stopwatch()..start();
|
final Stopwatch stopwatch = Stopwatch()..start();
|
||||||
|
|
||||||
final deviceAlbums = await _nativeSyncApi.getAlbums();
|
final deviceAlbums = await _nativeSyncApi.getAlbums();
|
||||||
final dbAlbums =
|
final dbAlbums = await _localAlbumRepository.getAll(sortBy: {SortLocalAlbumsBy.id});
|
||||||
await _localAlbumRepository.getAll(sortBy: {SortLocalAlbumsBy.id});
|
|
||||||
|
|
||||||
await diffSortedLists(
|
await diffSortedLists(
|
||||||
dbAlbums,
|
dbAlbums,
|
||||||
@ -120,9 +118,7 @@ class LocalSyncService {
|
|||||||
try {
|
try {
|
||||||
_log.fine("Adding device album ${album.name}");
|
_log.fine("Adding device album ${album.name}");
|
||||||
|
|
||||||
final assets = album.assetCount > 0
|
final assets = album.assetCount > 0 ? await _nativeSyncApi.getAssetsForAlbum(album.id) : <PlatformAsset>[];
|
||||||
? await _nativeSyncApi.getAssetsForAlbum(album.id)
|
|
||||||
: <PlatformAsset>[];
|
|
||||||
|
|
||||||
await _localAlbumRepository.upsert(
|
await _localAlbumRepository.upsert(
|
||||||
album,
|
album,
|
||||||
@ -188,10 +184,8 @@ class LocalSyncService {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
final updatedTime =
|
final updatedTime = (dbAlbum.updatedAt.millisecondsSinceEpoch ~/ 1000) + 1;
|
||||||
(dbAlbum.updatedAt.millisecondsSinceEpoch ~/ 1000) + 1;
|
final newAssetsCount = await _nativeSyncApi.getAssetsCountSince(deviceAlbum.id, updatedTime);
|
||||||
final newAssetsCount =
|
|
||||||
await _nativeSyncApi.getAssetsCountSince(deviceAlbum.id, updatedTime);
|
|
||||||
|
|
||||||
// Early return if no new assets were found
|
// Early return if no new assets were found
|
||||||
if (newAssetsCount == 0) {
|
if (newAssetsCount == 0) {
|
||||||
@ -230,13 +224,9 @@ class LocalSyncService {
|
|||||||
Future<bool> fullDiff(LocalAlbum dbAlbum, LocalAlbum deviceAlbum) async {
|
Future<bool> fullDiff(LocalAlbum dbAlbum, LocalAlbum deviceAlbum) async {
|
||||||
try {
|
try {
|
||||||
final assetsInDevice = deviceAlbum.assetCount > 0
|
final assetsInDevice = deviceAlbum.assetCount > 0
|
||||||
? await _nativeSyncApi
|
? await _nativeSyncApi.getAssetsForAlbum(deviceAlbum.id).then((a) => a.toLocalAssets())
|
||||||
.getAssetsForAlbum(deviceAlbum.id)
|
|
||||||
.then((a) => a.toLocalAssets())
|
|
||||||
: <LocalAsset>[];
|
|
||||||
final assetsInDb = dbAlbum.assetCount > 0
|
|
||||||
? await _localAlbumRepository.getAssets(dbAlbum.id)
|
|
||||||
: <LocalAsset>[];
|
: <LocalAsset>[];
|
||||||
|
final assetsInDb = dbAlbum.assetCount > 0 ? await _localAlbumRepository.getAssets(dbAlbum.id) : <LocalAsset>[];
|
||||||
|
|
||||||
if (deviceAlbum.assetCount == 0) {
|
if (deviceAlbum.assetCount == 0) {
|
||||||
_log.fine(
|
_log.fine(
|
||||||
@ -321,9 +311,7 @@ class LocalSyncService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool _albumsEqual(LocalAlbum a, LocalAlbum b) {
|
bool _albumsEqual(LocalAlbum a, LocalAlbum b) {
|
||||||
return a.name == b.name &&
|
return a.name == b.name && a.assetCount == b.assetCount && a.updatedAt.isAtSameMomentAs(b.updatedAt);
|
||||||
a.assetCount == b.assetCount &&
|
|
||||||
a.updatedAt.isAtSameMomentAs(b.updatedAt);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -333,9 +321,7 @@ extension on Iterable<PlatformAlbum> {
|
|||||||
(e) => LocalAlbum(
|
(e) => LocalAlbum(
|
||||||
id: e.id,
|
id: e.id,
|
||||||
name: e.name,
|
name: e.name,
|
||||||
updatedAt: e.updatedAt == null
|
updatedAt: e.updatedAt == null ? DateTime.now() : DateTime.fromMillisecondsSinceEpoch(e.updatedAt! * 1000),
|
||||||
? DateTime.now()
|
|
||||||
: DateTime.fromMillisecondsSinceEpoch(e.updatedAt! * 1000),
|
|
||||||
assetCount: e.assetCount,
|
assetCount: e.assetCount,
|
||||||
),
|
),
|
||||||
).toList();
|
).toList();
|
||||||
@ -350,12 +336,8 @@ extension on Iterable<PlatformAsset> {
|
|||||||
name: e.name,
|
name: e.name,
|
||||||
checksum: null,
|
checksum: null,
|
||||||
type: AssetType.values.elementAtOrNull(e.type) ?? AssetType.other,
|
type: AssetType.values.elementAtOrNull(e.type) ?? AssetType.other,
|
||||||
createdAt: e.createdAt == null
|
createdAt: e.createdAt == null ? DateTime.now() : DateTime.fromMillisecondsSinceEpoch(e.createdAt! * 1000),
|
||||||
? DateTime.now()
|
updatedAt: e.updatedAt == null ? DateTime.now() : DateTime.fromMillisecondsSinceEpoch(e.updatedAt! * 1000),
|
||||||
: DateTime.fromMillisecondsSinceEpoch(e.createdAt! * 1000),
|
|
||||||
updatedAt: e.updatedAt == null
|
|
||||||
? DateTime.now()
|
|
||||||
: DateTime.fromMillisecondsSinceEpoch(e.updatedAt! * 1000),
|
|
||||||
width: e.width,
|
width: e.width,
|
||||||
height: e.height,
|
height: e.height,
|
||||||
durationInSeconds: e.durationInSeconds,
|
durationInSeconds: e.durationInSeconds,
|
||||||
|
@ -56,8 +56,7 @@ class LogService {
|
|||||||
}) async {
|
}) async {
|
||||||
final instance = LogService._(logRepository, storeRepository, shouldBuffer);
|
final instance = LogService._(logRepository, storeRepository, shouldBuffer);
|
||||||
await logRepository.truncate(limit: kLogTruncateLimit);
|
await logRepository.truncate(limit: kLogTruncateLimit);
|
||||||
final level = await instance._storeRepository.tryGet(StoreKey.logLevel) ??
|
final level = await instance._storeRepository.tryGet(StoreKey.logLevel) ?? LogLevel.info.index;
|
||||||
LogLevel.info.index;
|
|
||||||
Logger.root.level = Level.LEVELS.elementAtOrNull(level) ?? Level.INFO;
|
Logger.root.level = Level.LEVELS.elementAtOrNull(level) ?? Level.INFO;
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
@ -146,9 +145,7 @@ class LoggerUnInitializedException implements Exception {
|
|||||||
|
|
||||||
/// Log levels according to dart logging [Level]
|
/// Log levels according to dart logging [Level]
|
||||||
extension LevelDomainToInfraExtension on Level {
|
extension LevelDomainToInfraExtension on Level {
|
||||||
LogLevel toLogLevel() =>
|
LogLevel toLogLevel() => LogLevel.values.elementAtOrNull(Level.LEVELS.indexOf(this)) ?? LogLevel.info;
|
||||||
LogLevel.values.elementAtOrNull(Level.LEVELS.indexOf(this)) ??
|
|
||||||
LogLevel.info;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extension on LogLevel {
|
extension on LogLevel {
|
||||||
|
@ -23,10 +23,8 @@ class DriftPartnerService {
|
|||||||
Future<List<PartnerUserDto>> getAvailablePartners(
|
Future<List<PartnerUserDto>> getAvailablePartners(
|
||||||
String currentUserId,
|
String currentUserId,
|
||||||
) async {
|
) async {
|
||||||
final otherUsers =
|
final otherUsers = await _driftPartnerRepository.getAvailablePartners(currentUserId);
|
||||||
await _driftPartnerRepository.getAvailablePartners(currentUserId);
|
final currentPartners = await _driftPartnerRepository.getSharedBy(currentUserId);
|
||||||
final currentPartners =
|
|
||||||
await _driftPartnerRepository.getSharedBy(currentUserId);
|
|
||||||
final available = otherUsers.where((user) {
|
final available = otherUsers.where((user) {
|
||||||
return !currentPartners.any((partner) => partner.id == user.id);
|
return !currentPartners.any((partner) => partner.id == user.id);
|
||||||
}).toList();
|
}).toList();
|
||||||
|
@ -44,8 +44,7 @@ class RemoteAlbumService {
|
|||||||
filtered = filtered
|
filtered = filtered
|
||||||
.where(
|
.where(
|
||||||
(album) =>
|
(album) =>
|
||||||
album.name.toLowerCase().contains(lowerQuery) ||
|
album.name.toLowerCase().contains(lowerQuery) || album.description.toLowerCase().contains(lowerQuery),
|
||||||
album.description.toLowerCase().contains(lowerQuery),
|
|
||||||
)
|
)
|
||||||
.toList();
|
.toList();
|
||||||
}
|
}
|
||||||
@ -53,12 +52,10 @@ class RemoteAlbumService {
|
|||||||
if (userId != null) {
|
if (userId != null) {
|
||||||
switch (filterMode) {
|
switch (filterMode) {
|
||||||
case QuickFilterMode.myAlbums:
|
case QuickFilterMode.myAlbums:
|
||||||
filtered =
|
filtered = filtered.where((album) => album.ownerId == userId).toList();
|
||||||
filtered.where((album) => album.ownerId == userId).toList();
|
|
||||||
break;
|
break;
|
||||||
case QuickFilterMode.sharedWithMe:
|
case QuickFilterMode.sharedWithMe:
|
||||||
filtered =
|
filtered = filtered.where((album) => album.ownerId != userId).toList();
|
||||||
filtered.where((album) => album.ownerId != userId).toList();
|
|
||||||
break;
|
break;
|
||||||
case QuickFilterMode.all:
|
case QuickFilterMode.all:
|
||||||
break;
|
break;
|
||||||
|
@ -9,16 +9,11 @@ final AppSetting = SettingsService(storeService: StoreService.I);
|
|||||||
class SettingsService {
|
class SettingsService {
|
||||||
final StoreService _storeService;
|
final StoreService _storeService;
|
||||||
|
|
||||||
const SettingsService({required StoreService storeService})
|
const SettingsService({required StoreService storeService}) : _storeService = storeService;
|
||||||
: _storeService = storeService;
|
|
||||||
|
|
||||||
T get<T>(Setting<T> setting) =>
|
T get<T>(Setting<T> setting) => _storeService.get(setting.storeKey, setting.defaultValue);
|
||||||
_storeService.get(setting.storeKey, setting.defaultValue);
|
|
||||||
|
|
||||||
Future<void> set<T>(Setting<T> setting, T value) =>
|
Future<void> set<T>(Setting<T> setting, T value) => _storeService.put(setting.storeKey, value);
|
||||||
_storeService.put(setting.storeKey, value);
|
|
||||||
|
|
||||||
Stream<T> watch<T>(Setting<T> setting) => _storeService
|
Stream<T> watch<T>(Setting<T> setting) => _storeService.watch(setting.storeKey).map((v) => v ?? setting.defaultValue);
|
||||||
.watch(setting.storeKey)
|
|
||||||
.map((v) => v ?? setting.defaultValue);
|
|
||||||
}
|
}
|
||||||
|
@ -12,8 +12,7 @@ class StoreService {
|
|||||||
final Map<int, Object?> _cache = {};
|
final Map<int, Object?> _cache = {};
|
||||||
late final StreamSubscription<StoreDto> _storeUpdateSubscription;
|
late final StreamSubscription<StoreDto> _storeUpdateSubscription;
|
||||||
|
|
||||||
StoreService._({required IsarStoreRepository storeRepository})
|
StoreService._({required IsarStoreRepository storeRepository}) : _storeRepository = storeRepository;
|
||||||
: _storeRepository = storeRepository;
|
|
||||||
|
|
||||||
// TODO: Temporary typedef to make minimal changes. Remove this and make the presentation layer access store through a provider
|
// TODO: Temporary typedef to make minimal changes. Remove this and make the presentation layer access store through a provider
|
||||||
static StoreService? _instance;
|
static StoreService? _instance;
|
||||||
@ -48,8 +47,7 @@ class StoreService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StreamSubscription<StoreDto> _listenForChange() =>
|
StreamSubscription<StoreDto> _listenForChange() => _storeRepository.watchAll().listen((event) {
|
||||||
_storeRepository.watchAll().listen((event) {
|
|
||||||
_cache[event.key.id] = event.value;
|
_cache[event.key.id] = event.value;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -34,14 +34,12 @@ class TimelineFactory {
|
|||||||
_settingsService = settingsService;
|
_settingsService = settingsService;
|
||||||
|
|
||||||
GroupAssetsBy get groupBy {
|
GroupAssetsBy get groupBy {
|
||||||
final group =
|
final group = GroupAssetsBy.values[_settingsService.get(Setting.groupAssetsBy)];
|
||||||
GroupAssetsBy.values[_settingsService.get(Setting.groupAssetsBy)];
|
|
||||||
// We do not support auto grouping in the new timeline yet, fallback to day grouping
|
// We do not support auto grouping in the new timeline yet, fallback to day grouping
|
||||||
return group == GroupAssetsBy.auto ? GroupAssetsBy.day : group;
|
return group == GroupAssetsBy.auto ? GroupAssetsBy.day : group;
|
||||||
}
|
}
|
||||||
|
|
||||||
TimelineService main(List<String> timelineUsers) =>
|
TimelineService main(List<String> timelineUsers) => TimelineService(_timelineRepository.main(timelineUsers, groupBy));
|
||||||
TimelineService(_timelineRepository.main(timelineUsers, groupBy));
|
|
||||||
|
|
||||||
TimelineService localAlbum({required String albumId}) =>
|
TimelineService localAlbum({required String albumId}) =>
|
||||||
TimelineService(_timelineRepository.localAlbum(albumId, groupBy));
|
TimelineService(_timelineRepository.localAlbum(albumId, groupBy));
|
||||||
@ -49,29 +47,21 @@ class TimelineFactory {
|
|||||||
TimelineService remoteAlbum({required String albumId}) =>
|
TimelineService remoteAlbum({required String albumId}) =>
|
||||||
TimelineService(_timelineRepository.remoteAlbum(albumId, groupBy));
|
TimelineService(_timelineRepository.remoteAlbum(albumId, groupBy));
|
||||||
|
|
||||||
TimelineService remoteAssets(String userId) =>
|
TimelineService remoteAssets(String userId) => TimelineService(_timelineRepository.remote(userId, groupBy));
|
||||||
TimelineService(_timelineRepository.remote(userId, groupBy));
|
|
||||||
|
|
||||||
TimelineService favorite(String userId) =>
|
TimelineService favorite(String userId) => TimelineService(_timelineRepository.favorite(userId, groupBy));
|
||||||
TimelineService(_timelineRepository.favorite(userId, groupBy));
|
|
||||||
|
|
||||||
TimelineService trash(String userId) =>
|
TimelineService trash(String userId) => TimelineService(_timelineRepository.trash(userId, groupBy));
|
||||||
TimelineService(_timelineRepository.trash(userId, groupBy));
|
|
||||||
|
|
||||||
TimelineService archive(String userId) =>
|
TimelineService archive(String userId) => TimelineService(_timelineRepository.archived(userId, groupBy));
|
||||||
TimelineService(_timelineRepository.archived(userId, groupBy));
|
|
||||||
|
|
||||||
TimelineService lockedFolder(String userId) =>
|
TimelineService lockedFolder(String userId) => TimelineService(_timelineRepository.locked(userId, groupBy));
|
||||||
TimelineService(_timelineRepository.locked(userId, groupBy));
|
|
||||||
|
|
||||||
TimelineService video(String userId) =>
|
TimelineService video(String userId) => TimelineService(_timelineRepository.video(userId, groupBy));
|
||||||
TimelineService(_timelineRepository.video(userId, groupBy));
|
|
||||||
|
|
||||||
TimelineService place(String place) =>
|
TimelineService place(String place) => TimelineService(_timelineRepository.place(place, groupBy));
|
||||||
TimelineService(_timelineRepository.place(place, groupBy));
|
|
||||||
|
|
||||||
TimelineService fromAssets(List<BaseAsset> assets) =>
|
TimelineService fromAssets(List<BaseAsset> assets) => TimelineService(_timelineRepository.fromAssets(assets));
|
||||||
TimelineService(_timelineRepository.fromAssets(assets));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class TimelineService {
|
class TimelineService {
|
||||||
@ -98,8 +88,7 @@ class TimelineService {
|
|||||||
_bucketSource = bucketSource {
|
_bucketSource = bucketSource {
|
||||||
_bucketSubscription = _bucketSource().listen((buckets) {
|
_bucketSubscription = _bucketSource().listen((buckets) {
|
||||||
_mutex.run(() async {
|
_mutex.run(() async {
|
||||||
final totalAssets =
|
final totalAssets = buckets.fold<int>(0, (acc, bucket) => acc + bucket.assetCount);
|
||||||
buckets.fold<int>(0, (acc, bucket) => acc + bucket.assetCount);
|
|
||||||
|
|
||||||
if (totalAssets == 0) {
|
if (totalAssets == 0) {
|
||||||
_bufferOffset = 0;
|
_bufferOffset = 0;
|
||||||
@ -132,8 +121,7 @@ class TimelineService {
|
|||||||
|
|
||||||
Stream<List<Bucket>> Function() get watchBuckets => _bucketSource;
|
Stream<List<Bucket>> Function() get watchBuckets => _bucketSource;
|
||||||
|
|
||||||
Future<List<BaseAsset>> loadAssets(int index, int count) =>
|
Future<List<BaseAsset>> loadAssets(int index, int count) => _mutex.run(() => _loadAssets(index, count));
|
||||||
_mutex.run(() => _loadAssets(index, count));
|
|
||||||
|
|
||||||
Future<List<BaseAsset>> _loadAssets(int index, int count) async {
|
Future<List<BaseAsset>> _loadAssets(int index, int count) async {
|
||||||
if (hasRange(index, count)) {
|
if (hasRange(index, count)) {
|
||||||
@ -182,11 +170,9 @@ class TimelineService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Pre-cache assets around the given index for asset viewer
|
// Pre-cache assets around the given index for asset viewer
|
||||||
Future<void> preCacheAssets(int index) =>
|
Future<void> preCacheAssets(int index) => _mutex.run(() => _loadAssets(index, math.min(5, _totalAssets - index)));
|
||||||
_mutex.run(() => _loadAssets(index, math.min(5, _totalAssets - index)));
|
|
||||||
|
|
||||||
BaseAsset getRandomAsset() =>
|
BaseAsset getRandomAsset() => _buffer.elementAt(math.Random().nextInt(_buffer.length));
|
||||||
_buffer.elementAt(math.Random().nextInt(_buffer.length));
|
|
||||||
|
|
||||||
BaseAsset getAsset(int index) {
|
BaseAsset getAsset(int index) {
|
||||||
if (!hasRange(index, 1)) {
|
if (!hasRange(index, 1)) {
|
||||||
|
@ -67,12 +67,10 @@ class BackgroundSyncManager {
|
|||||||
// captured by the closure passed to [runInIsolateGentle].
|
// captured by the closure passed to [runInIsolateGentle].
|
||||||
_deviceAlbumSyncTask = full
|
_deviceAlbumSyncTask = full
|
||||||
? runInIsolateGentle(
|
? runInIsolateGentle(
|
||||||
computation: (ref) =>
|
computation: (ref) => ref.read(localSyncServiceProvider).sync(full: true),
|
||||||
ref.read(localSyncServiceProvider).sync(full: true),
|
|
||||||
)
|
)
|
||||||
: runInIsolateGentle(
|
: runInIsolateGentle(
|
||||||
computation: (ref) =>
|
computation: (ref) => ref.read(localSyncServiceProvider).sync(full: false),
|
||||||
ref.read(localSyncServiceProvider).sync(full: false),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return _deviceAlbumSyncTask!.whenComplete(() {
|
return _deviceAlbumSyncTask!.whenComplete(() {
|
||||||
@ -139,7 +137,5 @@ Cancelable<void> _handleWsAssetUploadReadyV1Batch(
|
|||||||
List<dynamic> batchData,
|
List<dynamic> batchData,
|
||||||
) =>
|
) =>
|
||||||
runInIsolateGentle(
|
runInIsolateGentle(
|
||||||
computation: (ref) => ref
|
computation: (ref) => ref.read(syncStreamServiceProvider).handleWsAssetUploadReadyV1Batch(batchData),
|
||||||
.read(syncStreamServiceProvider)
|
|
||||||
.handleWsAssetUploadReadyV1Batch(batchData),
|
|
||||||
);
|
);
|
||||||
|
@ -9,8 +9,7 @@ class EventStream {
|
|||||||
|
|
||||||
static final EventStream shared = EventStream._();
|
static final EventStream shared = EventStream._();
|
||||||
|
|
||||||
final StreamController<Event> _controller =
|
final StreamController<Event> _controller = StreamController<Event>.broadcast();
|
||||||
StreamController<Event>.broadcast();
|
|
||||||
|
|
||||||
void emit(Event event) {
|
void emit(Event event) {
|
||||||
_controller.add(event);
|
_controller.add(event);
|
||||||
|
@ -95,13 +95,11 @@ class Album {
|
|||||||
// accessible in an object freshly created (not loaded from DB)
|
// accessible in an object freshly created (not loaded from DB)
|
||||||
|
|
||||||
@ignore
|
@ignore
|
||||||
Iterable<User> get remoteUsers => sharedUsers.isEmpty
|
Iterable<User> get remoteUsers =>
|
||||||
? (sharedUsers as IsarLinksCommon<User>).addedObjects
|
sharedUsers.isEmpty ? (sharedUsers as IsarLinksCommon<User>).addedObjects : sharedUsers;
|
||||||
: sharedUsers;
|
|
||||||
|
|
||||||
@ignore
|
@ignore
|
||||||
Iterable<Asset> get remoteAssets =>
|
Iterable<Asset> get remoteAssets => assets.isEmpty ? (assets as IsarLinksCommon<Asset>).addedObjects : assets;
|
||||||
assets.isEmpty ? (assets as IsarLinksCommon<Asset>).addedObjects : assets;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(other) {
|
bool operator ==(other) {
|
||||||
@ -164,15 +162,11 @@ class Album {
|
|||||||
a.remoteAssetCount = dto.assetCount;
|
a.remoteAssetCount = dto.assetCount;
|
||||||
a.owner.value = await db.users.getById(dto.ownerId);
|
a.owner.value = await db.users.getById(dto.ownerId);
|
||||||
if (dto.order != null) {
|
if (dto.order != null) {
|
||||||
a.sortOrder =
|
a.sortOrder = dto.order == AssetOrder.asc ? SortOrder.asc : SortOrder.desc;
|
||||||
dto.order == AssetOrder.asc ? SortOrder.asc : SortOrder.desc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dto.albumThumbnailAssetId != null) {
|
if (dto.albumThumbnailAssetId != null) {
|
||||||
a.thumbnail.value = await db.assets
|
a.thumbnail.value = await db.assets.where().remoteIdEqualTo(dto.albumThumbnailAssetId).findFirst();
|
||||||
.where()
|
|
||||||
.remoteIdEqualTo(dto.albumThumbnailAssetId)
|
|
||||||
.findFirst();
|
|
||||||
}
|
}
|
||||||
if (dto.albumUsers.isNotEmpty) {
|
if (dto.albumUsers.isNotEmpty) {
|
||||||
final users = await db.users.getAllById(
|
final users = await db.users.getAllById(
|
||||||
@ -181,16 +175,14 @@ class Album {
|
|||||||
a.sharedUsers.addAll(users.cast());
|
a.sharedUsers.addAll(users.cast());
|
||||||
}
|
}
|
||||||
if (dto.assets.isNotEmpty) {
|
if (dto.assets.isNotEmpty) {
|
||||||
final assets =
|
final assets = await db.assets.getAllByRemoteId(dto.assets.map((e) => e.id));
|
||||||
await db.assets.getAllByRemoteId(dto.assets.map((e) => e.id));
|
|
||||||
a.assets.addAll(assets);
|
a.assets.addAll(assets);
|
||||||
}
|
}
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() =>
|
String toString() => 'remoteId: $remoteId name: $name description: $description';
|
||||||
'remoteId: $remoteId name: $name description: $description';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extension AssetsHelper on IsarCollection<Album> {
|
extension AssetsHelper on IsarCollection<Album> {
|
||||||
|
@ -4,8 +4,7 @@ import 'dart:io';
|
|||||||
import 'package:immich_mobile/constants/enums.dart';
|
import 'package:immich_mobile/constants/enums.dart';
|
||||||
import 'package:immich_mobile/domain/models/exif.model.dart';
|
import 'package:immich_mobile/domain/models/exif.model.dart';
|
||||||
import 'package:immich_mobile/extensions/string_extensions.dart';
|
import 'package:immich_mobile/extensions/string_extensions.dart';
|
||||||
import 'package:immich_mobile/infrastructure/entities/exif.entity.dart'
|
import 'package:immich_mobile/infrastructure/entities/exif.entity.dart' as entity;
|
||||||
as entity;
|
|
||||||
import 'package:immich_mobile/infrastructure/utils/exif.converter.dart';
|
import 'package:immich_mobile/infrastructure/utils/exif.converter.dart';
|
||||||
import 'package:immich_mobile/utils/diff.dart';
|
import 'package:immich_mobile/utils/diff.dart';
|
||||||
import 'package:immich_mobile/utils/hash.dart';
|
import 'package:immich_mobile/utils/hash.dart';
|
||||||
@ -32,18 +31,14 @@ class Asset {
|
|||||||
width = remote.exifInfo?.exifImageWidth?.toInt(),
|
width = remote.exifInfo?.exifImageWidth?.toInt(),
|
||||||
livePhotoVideoId = remote.livePhotoVideoId,
|
livePhotoVideoId = remote.livePhotoVideoId,
|
||||||
ownerId = fastHash(remote.ownerId),
|
ownerId = fastHash(remote.ownerId),
|
||||||
exifInfo = remote.exifInfo == null
|
exifInfo = remote.exifInfo == null ? null : ExifDtoConverter.fromDto(remote.exifInfo!),
|
||||||
? null
|
|
||||||
: ExifDtoConverter.fromDto(remote.exifInfo!),
|
|
||||||
isFavorite = remote.isFavorite,
|
isFavorite = remote.isFavorite,
|
||||||
isArchived = remote.isArchived,
|
isArchived = remote.isArchived,
|
||||||
isTrashed = remote.isTrashed,
|
isTrashed = remote.isTrashed,
|
||||||
isOffline = remote.isOffline,
|
isOffline = remote.isOffline,
|
||||||
// workaround to nullify stackPrimaryAssetId for the parent asset until we refactor the mobile app
|
// workaround to nullify stackPrimaryAssetId for the parent asset until we refactor the mobile app
|
||||||
// stack handling to properly handle it
|
// stack handling to properly handle it
|
||||||
stackPrimaryAssetId = remote.stack?.primaryAssetId == remote.id
|
stackPrimaryAssetId = remote.stack?.primaryAssetId == remote.id ? null : remote.stack?.primaryAssetId,
|
||||||
? null
|
|
||||||
: remote.stack?.primaryAssetId,
|
|
||||||
stackCount = remote.stack?.assetCount ?? 0,
|
stackCount = remote.stack?.assetCount ?? 0,
|
||||||
stackId = remote.stack?.id,
|
stackId = remote.stack?.id,
|
||||||
thumbhash = remote.thumbhash,
|
thumbhash = remote.thumbhash,
|
||||||
@ -108,8 +103,7 @@ class Asset {
|
|||||||
throw Exception('Asset $fileName has no local data');
|
throw Exception('Asset $fileName has no local data');
|
||||||
}
|
}
|
||||||
|
|
||||||
final updatedLocal =
|
final updatedLocal = _didUpdateLocal ? local : await local.obtainForNewProperties();
|
||||||
_didUpdateLocal ? local : await local.obtainForNewProperties();
|
|
||||||
if (updatedLocal == null) {
|
if (updatedLocal == null) {
|
||||||
throw Exception('Could not fetch local data for $fileName');
|
throw Exception('Could not fetch local data for $fileName');
|
||||||
}
|
}
|
||||||
@ -185,10 +179,7 @@ class Asset {
|
|||||||
final orientatedWidth = this.orientatedWidth;
|
final orientatedWidth = this.orientatedWidth;
|
||||||
final orientatedHeight = this.orientatedHeight;
|
final orientatedHeight = this.orientatedHeight;
|
||||||
|
|
||||||
if (orientatedWidth != null &&
|
if (orientatedWidth != null && orientatedHeight != null && orientatedWidth > 0 && orientatedHeight > 0) {
|
||||||
orientatedHeight != null &&
|
|
||||||
orientatedWidth > 0 &&
|
|
||||||
orientatedHeight > 0) {
|
|
||||||
return orientatedWidth.toDouble() / orientatedHeight.toDouble();
|
return orientatedWidth.toDouble() / orientatedHeight.toDouble();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -389,8 +380,7 @@ class Asset {
|
|||||||
// workaround to nullify stackPrimaryAssetId for the parent asset until we refactor the mobile app
|
// workaround to nullify stackPrimaryAssetId for the parent asset until we refactor the mobile app
|
||||||
// stack handling to properly handle it
|
// stack handling to properly handle it
|
||||||
stackId: stackId,
|
stackId: stackId,
|
||||||
stackPrimaryAssetId:
|
stackPrimaryAssetId: stackPrimaryAssetId == remoteId ? null : stackPrimaryAssetId,
|
||||||
stackPrimaryAssetId == remoteId ? null : stackPrimaryAssetId,
|
|
||||||
stackCount: stackCount,
|
stackCount: stackCount,
|
||||||
isFavorite: isFavorite,
|
isFavorite: isFavorite,
|
||||||
isArchived: isArchived,
|
isArchived: isArchived,
|
||||||
@ -410,9 +400,7 @@ class Asset {
|
|||||||
// workaround to nullify stackPrimaryAssetId for the parent asset until we refactor the mobile app
|
// workaround to nullify stackPrimaryAssetId for the parent asset until we refactor the mobile app
|
||||||
// stack handling to properly handle it
|
// stack handling to properly handle it
|
||||||
stackId: a.stackId,
|
stackId: a.stackId,
|
||||||
stackPrimaryAssetId: a.stackPrimaryAssetId == a.remoteId
|
stackPrimaryAssetId: a.stackPrimaryAssetId == a.remoteId ? null : a.stackPrimaryAssetId,
|
||||||
? null
|
|
||||||
: a.stackPrimaryAssetId,
|
|
||||||
stackCount: a.stackCount,
|
stackCount: a.stackCount,
|
||||||
// isFavorite + isArchived are not set by device-only assets
|
// isFavorite + isArchived are not set by device-only assets
|
||||||
isFavorite: a.isFavorite,
|
isFavorite: a.isFavorite,
|
||||||
@ -428,8 +416,7 @@ class Asset {
|
|||||||
localId: localId ?? a.localId,
|
localId: localId ?? a.localId,
|
||||||
width: width ?? a.width,
|
width: width ?? a.width,
|
||||||
height: height ?? a.height,
|
height: height ?? a.height,
|
||||||
exifInfo: exifInfo ??
|
exifInfo: exifInfo ?? a.exifInfo?.copyWith(assetId: id), // updated to use assetId
|
||||||
a.exifInfo?.copyWith(assetId: id), // updated to use assetId
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -491,18 +478,15 @@ class Asset {
|
|||||||
Future<void> put(Isar db) async {
|
Future<void> put(Isar db) async {
|
||||||
await db.assets.put(this);
|
await db.assets.put(this);
|
||||||
if (exifInfo != null) {
|
if (exifInfo != null) {
|
||||||
await db.exifInfos
|
await db.exifInfos.put(entity.ExifInfo.fromDto(exifInfo!.copyWith(assetId: id)));
|
||||||
.put(entity.ExifInfo.fromDto(exifInfo!.copyWith(assetId: id)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int compareById(Asset a, Asset b) => a.id.compareTo(b.id);
|
static int compareById(Asset a, Asset b) => a.id.compareTo(b.id);
|
||||||
|
|
||||||
static int compareByLocalId(Asset a, Asset b) =>
|
static int compareByLocalId(Asset a, Asset b) => compareToNullable(a.localId, b.localId);
|
||||||
compareToNullable(a.localId, b.localId);
|
|
||||||
|
|
||||||
static int compareByChecksum(Asset a, Asset b) =>
|
static int compareByChecksum(Asset a, Asset b) => a.checksum.compareTo(b.checksum);
|
||||||
a.checksum.compareTo(b.checksum);
|
|
||||||
|
|
||||||
static int compareByOwnerChecksum(Asset a, Asset b) {
|
static int compareByOwnerChecksum(Asset a, Asset b) {
|
||||||
final int ownerIdOrder = a.ownerId.compareTo(b.ownerId);
|
final int ownerIdOrder = a.ownerId.compareTo(b.ownerId);
|
||||||
@ -589,16 +573,11 @@ enum AssetState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extension AssetsHelper on IsarCollection<Asset> {
|
extension AssetsHelper on IsarCollection<Asset> {
|
||||||
Future<int> deleteAllByRemoteId(Iterable<String> ids) =>
|
Future<int> deleteAllByRemoteId(Iterable<String> ids) => ids.isEmpty ? Future.value(0) : remote(ids).deleteAll();
|
||||||
ids.isEmpty ? Future.value(0) : remote(ids).deleteAll();
|
Future<int> deleteAllByLocalId(Iterable<String> ids) => ids.isEmpty ? Future.value(0) : local(ids).deleteAll();
|
||||||
Future<int> deleteAllByLocalId(Iterable<String> ids) =>
|
Future<List<Asset>> getAllByRemoteId(Iterable<String> ids) => ids.isEmpty ? Future.value([]) : remote(ids).findAll();
|
||||||
ids.isEmpty ? Future.value(0) : local(ids).deleteAll();
|
Future<List<Asset>> getAllByLocalId(Iterable<String> ids) => ids.isEmpty ? Future.value([]) : local(ids).findAll();
|
||||||
Future<List<Asset>> getAllByRemoteId(Iterable<String> ids) =>
|
Future<Asset?> getByRemoteId(String id) => where().remoteIdEqualTo(id).findFirst();
|
||||||
ids.isEmpty ? Future.value([]) : remote(ids).findAll();
|
|
||||||
Future<List<Asset>> getAllByLocalId(Iterable<String> ids) =>
|
|
||||||
ids.isEmpty ? Future.value([]) : local(ids).findAll();
|
|
||||||
Future<Asset?> getByRemoteId(String id) =>
|
|
||||||
where().remoteIdEqualTo(id).findFirst();
|
|
||||||
|
|
||||||
QueryBuilder<Asset, Asset, QAfterWhereClause> remote(
|
QueryBuilder<Asset, Asset, QAfterWhereClause> remote(
|
||||||
Iterable<String> ids,
|
Iterable<String> ids,
|
||||||
|
@ -22,15 +22,13 @@ extension LogOnError<T> on AsyncValue<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!skip) {
|
if (!skip) {
|
||||||
return onLoading?.call() ??
|
return onLoading?.call() ?? const Center(child: ImmichLoadingIndicator());
|
||||||
const Center(child: ImmichLoadingIndicator());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasError && !hasValue) {
|
if (hasError && !hasValue) {
|
||||||
_asyncErrorLogger.severe('Could not load value', error, stackTrace);
|
_asyncErrorLogger.severe('Could not load value', error, stackTrace);
|
||||||
return onError?.call(error, stackTrace) ??
|
return onError?.call(error, stackTrace) ?? ScaffoldErrorBody(errorMsg: error?.toString());
|
||||||
ScaffoldErrorBody(errorMsg: error?.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return onData(requireValue);
|
return onData(requireValue);
|
||||||
|
@ -60,6 +60,5 @@ extension ContextHelper on BuildContext {
|
|||||||
FocusScopeNode get focusScope => FocusScope.of(this);
|
FocusScopeNode get focusScope => FocusScope.of(this);
|
||||||
|
|
||||||
// Show SnackBars from the current context
|
// Show SnackBars from the current context
|
||||||
void showSnackBar(SnackBar snackBar) =>
|
void showSnackBar(SnackBar snackBar) => ScaffoldMessenger.of(this).showSnackBar(snackBar);
|
||||||
ScaffoldMessenger.of(this).showSnackBar(snackBar);
|
|
||||||
}
|
}
|
||||||
|
@ -57,9 +57,7 @@ extension DateRangeFormatting on DateTime {
|
|||||||
final localeString = locale?.toString() ?? 'en_US';
|
final localeString = locale?.toString() ?? 'en_US';
|
||||||
|
|
||||||
// Check if it's a single date (same day)
|
// Check if it's a single date (same day)
|
||||||
if (startDate.year == endDate.year &&
|
if (startDate.year == endDate.year && startDate.month == endDate.month && startDate.day == endDate.day) {
|
||||||
startDate.month == endDate.month &&
|
|
||||||
startDate.day == endDate.day) {
|
|
||||||
if (startDate.year == currentYear) {
|
if (startDate.year == currentYear) {
|
||||||
// Single date of this year: "Aug 28"
|
// Single date of this year: "Aug 28"
|
||||||
return DateFormat.MMMd(localeString).format(startDate);
|
return DateFormat.MMMd(localeString).format(startDate);
|
||||||
|
@ -12,9 +12,7 @@ extension DurationExtension on String {
|
|||||||
/// Parses and returns the string of format HH:MM:SS as a duration object else null
|
/// Parses and returns the string of format HH:MM:SS as a duration object else null
|
||||||
Duration? toDuration() {
|
Duration? toDuration() {
|
||||||
try {
|
try {
|
||||||
final parts = split(':')
|
final parts = split(':').map((e) => double.parse(e).toInt()).toList(growable: false);
|
||||||
.map((e) => double.parse(e).toInt())
|
|
||||||
.toList(growable: false);
|
|
||||||
return Duration(hours: parts[0], minutes: parts[1], seconds: parts[2]);
|
return Duration(hours: parts[0], minutes: parts[1], seconds: parts[2]);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -2,9 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
|
|
||||||
extension ImmichColorSchemeExtensions on ColorScheme {
|
extension ImmichColorSchemeExtensions on ColorScheme {
|
||||||
bool get _isDarkMode => brightness == Brightness.dark;
|
bool get _isDarkMode => brightness == Brightness.dark;
|
||||||
Color get onSurfaceSecondary => _isDarkMode
|
Color get onSurfaceSecondary => _isDarkMode ? onSurface.darken(amount: .3) : onSurface.lighten(amount: .3);
|
||||||
? onSurface.darken(amount: .3)
|
|
||||||
: onSurface.lighten(amount: .3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extension ColorExtensions on Color {
|
extension ColorExtensions on Color {
|
||||||
|
@ -40,8 +40,7 @@ String _translateHelper(
|
|||||||
try {
|
try {
|
||||||
final translatedMessage = key.tr(context: context);
|
final translatedMessage = key.tr(context: context);
|
||||||
return args != null
|
return args != null
|
||||||
? MessageFormat(translatedMessage, locale: Intl.defaultLocale ?? 'en')
|
? MessageFormat(translatedMessage, locale: Intl.defaultLocale ?? 'en').format(args)
|
||||||
.format(args)
|
|
||||||
: translatedMessage;
|
: translatedMessage;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
debugPrint('Translation failed for key "$key". Error: $e');
|
debugPrint('Translation failed for key "$key". Error: $e');
|
||||||
|
@ -8,12 +8,9 @@ class AssetFaceEntity extends Table with DriftDefaultsMixin {
|
|||||||
|
|
||||||
TextColumn get id => text()();
|
TextColumn get id => text()();
|
||||||
|
|
||||||
TextColumn get assetId =>
|
TextColumn get assetId => text().references(RemoteAssetEntity, #id, onDelete: KeyAction.cascade)();
|
||||||
text().references(RemoteAssetEntity, #id, onDelete: KeyAction.cascade)();
|
|
||||||
|
|
||||||
TextColumn get personId => text()
|
TextColumn get personId => text().nullable().references(PersonEntity, #id, onDelete: KeyAction.setNull)();
|
||||||
.nullable()
|
|
||||||
.references(PersonEntity, #id, onDelete: KeyAction.setNull)();
|
|
||||||
|
|
||||||
IntColumn get imageWidth => integer()();
|
IntColumn get imageWidth => integer()();
|
||||||
|
|
||||||
|
@ -98,8 +98,7 @@ class ExifInfo {
|
|||||||
class RemoteExifEntity extends Table with DriftDefaultsMixin {
|
class RemoteExifEntity extends Table with DriftDefaultsMixin {
|
||||||
const RemoteExifEntity();
|
const RemoteExifEntity();
|
||||||
|
|
||||||
TextColumn get assetId =>
|
TextColumn get assetId => text().references(RemoteAssetEntity, #id, onDelete: KeyAction.cascade)();
|
||||||
text().references(RemoteAssetEntity, #id, onDelete: KeyAction.cascade)();
|
|
||||||
|
|
||||||
TextColumn get city => text().nullable()();
|
TextColumn get city => text().nullable()();
|
||||||
|
|
||||||
|
@ -9,8 +9,7 @@ class LocalAlbumEntity extends Table with DriftDefaultsMixin {
|
|||||||
TextColumn get name => text()();
|
TextColumn get name => text()();
|
||||||
DateTimeColumn get updatedAt => dateTime().withDefault(currentDateAndTime)();
|
DateTimeColumn get updatedAt => dateTime().withDefault(currentDateAndTime)();
|
||||||
IntColumn get backupSelection => intEnum<BackupSelection>()();
|
IntColumn get backupSelection => intEnum<BackupSelection>()();
|
||||||
BoolColumn get isIosSharedAlbum =>
|
BoolColumn get isIosSharedAlbum => boolean().withDefault(const Constant(false))();
|
||||||
boolean().withDefault(const Constant(false))();
|
|
||||||
|
|
||||||
// Used for mark & sweep
|
// Used for mark & sweep
|
||||||
BoolColumn get marker_ => boolean().nullable()();
|
BoolColumn get marker_ => boolean().nullable()();
|
||||||
|
@ -6,11 +6,9 @@ import 'package:immich_mobile/infrastructure/utils/drift_default.mixin.dart';
|
|||||||
class LocalAlbumAssetEntity extends Table with DriftDefaultsMixin {
|
class LocalAlbumAssetEntity extends Table with DriftDefaultsMixin {
|
||||||
const LocalAlbumAssetEntity();
|
const LocalAlbumAssetEntity();
|
||||||
|
|
||||||
TextColumn get assetId =>
|
TextColumn get assetId => text().references(LocalAssetEntity, #id, onDelete: KeyAction.cascade)();
|
||||||
text().references(LocalAssetEntity, #id, onDelete: KeyAction.cascade)();
|
|
||||||
|
|
||||||
TextColumn get albumId =>
|
TextColumn get albumId => text().references(LocalAlbumEntity, #id, onDelete: KeyAction.cascade)();
|
||||||
text().references(LocalAlbumEntity, #id, onDelete: KeyAction.cascade)();
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Set<Column> get primaryKey => {assetId, albumId};
|
Set<Column> get primaryKey => {assetId, albumId};
|
||||||
|
@ -14,8 +14,7 @@ class MemoryEntity extends Table with DriftDefaultsMixin {
|
|||||||
|
|
||||||
DateTimeColumn get deletedAt => dateTime().nullable()();
|
DateTimeColumn get deletedAt => dateTime().nullable()();
|
||||||
|
|
||||||
TextColumn get ownerId =>
|
TextColumn get ownerId => text().references(UserEntity, #id, onDelete: KeyAction.cascade)();
|
||||||
text().references(UserEntity, #id, onDelete: KeyAction.cascade)();
|
|
||||||
|
|
||||||
IntColumn get type => intEnum<MemoryTypeEnum>()();
|
IntColumn get type => intEnum<MemoryTypeEnum>()();
|
||||||
|
|
||||||
|
@ -6,11 +6,9 @@ import 'package:immich_mobile/infrastructure/utils/drift_default.mixin.dart';
|
|||||||
class MemoryAssetEntity extends Table with DriftDefaultsMixin {
|
class MemoryAssetEntity extends Table with DriftDefaultsMixin {
|
||||||
const MemoryAssetEntity();
|
const MemoryAssetEntity();
|
||||||
|
|
||||||
TextColumn get assetId =>
|
TextColumn get assetId => text().references(RemoteAssetEntity, #id, onDelete: KeyAction.cascade)();
|
||||||
text().references(RemoteAssetEntity, #id, onDelete: KeyAction.cascade)();
|
|
||||||
|
|
||||||
TextColumn get memoryId =>
|
TextColumn get memoryId => text().references(MemoryEntity, #id, onDelete: KeyAction.cascade)();
|
||||||
text().references(MemoryEntity, #id, onDelete: KeyAction.cascade)();
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Set<Column> get primaryKey => {assetId, memoryId};
|
Set<Column> get primaryKey => {assetId, memoryId};
|
||||||
|
@ -5,11 +5,9 @@ import 'package:immich_mobile/infrastructure/utils/drift_default.mixin.dart';
|
|||||||
class PartnerEntity extends Table with DriftDefaultsMixin {
|
class PartnerEntity extends Table with DriftDefaultsMixin {
|
||||||
const PartnerEntity();
|
const PartnerEntity();
|
||||||
|
|
||||||
TextColumn get sharedById =>
|
TextColumn get sharedById => text().references(UserEntity, #id, onDelete: KeyAction.cascade)();
|
||||||
text().references(UserEntity, #id, onDelete: KeyAction.cascade)();
|
|
||||||
|
|
||||||
TextColumn get sharedWithId =>
|
TextColumn get sharedWithId => text().references(UserEntity, #id, onDelete: KeyAction.cascade)();
|
||||||
text().references(UserEntity, #id, onDelete: KeyAction.cascade)();
|
|
||||||
|
|
||||||
BoolColumn get inTimeline => boolean().withDefault(const Constant(false))();
|
BoolColumn get inTimeline => boolean().withDefault(const Constant(false))();
|
||||||
|
|
||||||
|
@ -11,8 +11,7 @@ class PersonEntity extends Table with DriftDefaultsMixin {
|
|||||||
|
|
||||||
DateTimeColumn get updatedAt => dateTime().withDefault(currentDateAndTime)();
|
DateTimeColumn get updatedAt => dateTime().withDefault(currentDateAndTime)();
|
||||||
|
|
||||||
TextColumn get ownerId =>
|
TextColumn get ownerId => text().references(UserEntity, #id, onDelete: KeyAction.cascade)();
|
||||||
text().references(UserEntity, #id, onDelete: KeyAction.cascade)();
|
|
||||||
|
|
||||||
TextColumn get name => text()();
|
TextColumn get name => text()();
|
||||||
|
|
||||||
|
@ -17,15 +17,12 @@ class RemoteAlbumEntity extends Table with DriftDefaultsMixin {
|
|||||||
|
|
||||||
DateTimeColumn get updatedAt => dateTime().withDefault(currentDateAndTime)();
|
DateTimeColumn get updatedAt => dateTime().withDefault(currentDateAndTime)();
|
||||||
|
|
||||||
TextColumn get ownerId =>
|
TextColumn get ownerId => text().references(UserEntity, #id, onDelete: KeyAction.cascade)();
|
||||||
text().references(UserEntity, #id, onDelete: KeyAction.cascade)();
|
|
||||||
|
|
||||||
TextColumn get thumbnailAssetId => text()
|
TextColumn get thumbnailAssetId =>
|
||||||
.references(RemoteAssetEntity, #id, onDelete: KeyAction.setNull)
|
text().references(RemoteAssetEntity, #id, onDelete: KeyAction.setNull).nullable()();
|
||||||
.nullable()();
|
|
||||||
|
|
||||||
BoolColumn get isActivityEnabled =>
|
BoolColumn get isActivityEnabled => boolean().withDefault(const Constant(true))();
|
||||||
boolean().withDefault(const Constant(true))();
|
|
||||||
|
|
||||||
IntColumn get order => intEnum<AlbumAssetOrder>()();
|
IntColumn get order => intEnum<AlbumAssetOrder>()();
|
||||||
|
|
||||||
|
@ -6,11 +6,9 @@ import 'package:immich_mobile/infrastructure/utils/drift_default.mixin.dart';
|
|||||||
class RemoteAlbumAssetEntity extends Table with DriftDefaultsMixin {
|
class RemoteAlbumAssetEntity extends Table with DriftDefaultsMixin {
|
||||||
const RemoteAlbumAssetEntity();
|
const RemoteAlbumAssetEntity();
|
||||||
|
|
||||||
TextColumn get assetId =>
|
TextColumn get assetId => text().references(RemoteAssetEntity, #id, onDelete: KeyAction.cascade)();
|
||||||
text().references(RemoteAssetEntity, #id, onDelete: KeyAction.cascade)();
|
|
||||||
|
|
||||||
TextColumn get albumId =>
|
TextColumn get albumId => text().references(RemoteAlbumEntity, #id, onDelete: KeyAction.cascade)();
|
||||||
text().references(RemoteAlbumEntity, #id, onDelete: KeyAction.cascade)();
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Set<Column> get primaryKey => {assetId, albumId};
|
Set<Column> get primaryKey => {assetId, albumId};
|
||||||
|
@ -7,11 +7,9 @@ import 'package:immich_mobile/infrastructure/utils/drift_default.mixin.dart';
|
|||||||
class RemoteAlbumUserEntity extends Table with DriftDefaultsMixin {
|
class RemoteAlbumUserEntity extends Table with DriftDefaultsMixin {
|
||||||
const RemoteAlbumUserEntity();
|
const RemoteAlbumUserEntity();
|
||||||
|
|
||||||
TextColumn get albumId =>
|
TextColumn get albumId => text().references(RemoteAlbumEntity, #id, onDelete: KeyAction.cascade)();
|
||||||
text().references(RemoteAlbumEntity, #id, onDelete: KeyAction.cascade)();
|
|
||||||
|
|
||||||
TextColumn get userId =>
|
TextColumn get userId => text().references(UserEntity, #id, onDelete: KeyAction.cascade)();
|
||||||
text().references(UserEntity, #id, onDelete: KeyAction.cascade)();
|
|
||||||
|
|
||||||
IntColumn get role => intEnum<AlbumUserRole>()();
|
IntColumn get role => intEnum<AlbumUserRole>()();
|
||||||
|
|
||||||
|
@ -11,8 +11,7 @@ import 'package:immich_mobile/infrastructure/utils/drift_default.mixin.dart';
|
|||||||
unique: true,
|
unique: true,
|
||||||
)
|
)
|
||||||
@TableIndex(name: 'idx_remote_asset_checksum', columns: {#checksum})
|
@TableIndex(name: 'idx_remote_asset_checksum', columns: {#checksum})
|
||||||
class RemoteAssetEntity extends Table
|
class RemoteAssetEntity extends Table with DriftDefaultsMixin, AssetEntityMixin {
|
||||||
with DriftDefaultsMixin, AssetEntityMixin {
|
|
||||||
const RemoteAssetEntity();
|
const RemoteAssetEntity();
|
||||||
|
|
||||||
TextColumn get id => text()();
|
TextColumn get id => text()();
|
||||||
@ -21,8 +20,7 @@ class RemoteAssetEntity extends Table
|
|||||||
|
|
||||||
BoolColumn get isFavorite => boolean().withDefault(const Constant(false))();
|
BoolColumn get isFavorite => boolean().withDefault(const Constant(false))();
|
||||||
|
|
||||||
TextColumn get ownerId =>
|
TextColumn get ownerId => text().references(UserEntity, #id, onDelete: KeyAction.cascade)();
|
||||||
text().references(UserEntity, #id, onDelete: KeyAction.cascade)();
|
|
||||||
|
|
||||||
DateTimeColumn get localDateTime => dateTime().nullable()();
|
DateTimeColumn get localDateTime => dateTime().nullable()();
|
||||||
|
|
||||||
|
@ -11,8 +11,7 @@ class StackEntity extends Table with DriftDefaultsMixin {
|
|||||||
|
|
||||||
DateTimeColumn get updatedAt => dateTime().withDefault(currentDateAndTime)();
|
DateTimeColumn get updatedAt => dateTime().withDefault(currentDateAndTime)();
|
||||||
|
|
||||||
TextColumn get ownerId =>
|
TextColumn get ownerId => text().references(UserEntity, #id, onDelete: KeyAction.cascade)();
|
||||||
text().references(UserEntity, #id, onDelete: KeyAction.cascade)();
|
|
||||||
|
|
||||||
TextColumn get primaryAssetId => text()();
|
TextColumn get primaryAssetId => text()();
|
||||||
|
|
||||||
|
@ -6,8 +6,7 @@ import 'package:immich_mobile/infrastructure/utils/drift_default.mixin.dart';
|
|||||||
class UserMetadataEntity extends Table with DriftDefaultsMixin {
|
class UserMetadataEntity extends Table with DriftDefaultsMixin {
|
||||||
const UserMetadataEntity();
|
const UserMetadataEntity();
|
||||||
|
|
||||||
TextColumn get userId =>
|
TextColumn get userId => text().references(UserEntity, #id, onDelete: KeyAction.cascade)();
|
||||||
text().references(UserEntity, #id, onDelete: KeyAction.cascade)();
|
|
||||||
|
|
||||||
IntColumn get key => intEnum<UserMetadataKey>()();
|
IntColumn get key => intEnum<UserMetadataKey>()();
|
||||||
|
|
||||||
@ -17,7 +16,6 @@ class UserMetadataEntity extends Table with DriftDefaultsMixin {
|
|||||||
Set<Column> get primaryKey => {userId, key};
|
Set<Column> get primaryKey => {userId, key};
|
||||||
}
|
}
|
||||||
|
|
||||||
final JsonTypeConverter2<Map<String, Object?>, Uint8List, Object?>
|
final JsonTypeConverter2<Map<String, Object?>, Uint8List, Object?> userMetadataConverter = TypeConverter.jsonb(
|
||||||
userMetadataConverter = TypeConverter.jsonb(
|
|
||||||
fromJson: (json) => json as Map<String, Object?>,
|
fromJson: (json) => json as Map<String, Object?>,
|
||||||
);
|
);
|
||||||
|
@ -8,10 +8,7 @@ class DriftAssetFaceRepository extends DriftDatabaseRepository {
|
|||||||
const DriftAssetFaceRepository(this._db) : super(_db);
|
const DriftAssetFaceRepository(this._db) : super(_db);
|
||||||
|
|
||||||
Future<List<AssetFace>> getAll() {
|
Future<List<AssetFace>> getAll() {
|
||||||
return _db.assetFaceEntity
|
return _db.assetFaceEntity.select().map((assetFace) => assetFace.toDto()).get();
|
||||||
.select()
|
|
||||||
.map((assetFace) => assetFace.toDto())
|
|
||||||
.get();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,8 +25,7 @@ class DriftBackupRepository extends DriftDatabaseRepository {
|
|||||||
),
|
),
|
||||||
])
|
])
|
||||||
..where(
|
..where(
|
||||||
_db.localAlbumEntity.backupSelection
|
_db.localAlbumEntity.backupSelection.equalsValue(BackupSelection.excluded),
|
||||||
.equalsValue(BackupSelection.excluded),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,10 +40,8 @@ class DriftBackupRepository extends DriftDatabaseRepository {
|
|||||||
),
|
),
|
||||||
])
|
])
|
||||||
..where(
|
..where(
|
||||||
_db.localAlbumEntity.backupSelection
|
_db.localAlbumEntity.backupSelection.equalsValue(BackupSelection.selected) &
|
||||||
.equalsValue(BackupSelection.selected) &
|
_db.localAlbumAssetEntity.assetId.isNotInQuery(_getExcludedSubquery()),
|
||||||
_db.localAlbumAssetEntity.assetId
|
|
||||||
.isNotInQuery(_getExcludedSubquery()),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return query.get().then((rows) => rows.length);
|
return query.get().then((rows) => rows.length);
|
||||||
@ -66,18 +63,14 @@ class DriftBackupRepository extends DriftDatabaseRepository {
|
|||||||
),
|
),
|
||||||
leftOuterJoin(
|
leftOuterJoin(
|
||||||
_db.remoteAssetEntity,
|
_db.remoteAssetEntity,
|
||||||
_db.localAssetEntity.checksum
|
_db.localAssetEntity.checksum.equalsExp(_db.remoteAssetEntity.checksum),
|
||||||
.equalsExp(_db.remoteAssetEntity.checksum),
|
|
||||||
useColumns: false,
|
useColumns: false,
|
||||||
),
|
),
|
||||||
])
|
])
|
||||||
..where(
|
..where(
|
||||||
_db.localAlbumEntity.backupSelection
|
_db.localAlbumEntity.backupSelection.equalsValue(BackupSelection.selected) &
|
||||||
.equalsValue(BackupSelection.selected) &
|
(_db.remoteAssetEntity.id.isNull() | _db.remoteAssetEntity.ownerId.equals(userId).not()) &
|
||||||
(_db.remoteAssetEntity.id.isNull() |
|
_db.localAlbumAssetEntity.assetId.isNotInQuery(_getExcludedSubquery()),
|
||||||
_db.remoteAssetEntity.ownerId.equals(userId).not()) &
|
|
||||||
_db.localAlbumAssetEntity.assetId
|
|
||||||
.isNotInQuery(_getExcludedSubquery()),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return query.get().then((rows) => rows.length);
|
return query.get().then((rows) => rows.length);
|
||||||
@ -101,18 +94,15 @@ class DriftBackupRepository extends DriftDatabaseRepository {
|
|||||||
),
|
),
|
||||||
innerJoin(
|
innerJoin(
|
||||||
_db.remoteAssetEntity,
|
_db.remoteAssetEntity,
|
||||||
_db.localAssetEntity.checksum
|
_db.localAssetEntity.checksum.equalsExp(_db.remoteAssetEntity.checksum),
|
||||||
.equalsExp(_db.remoteAssetEntity.checksum),
|
|
||||||
useColumns: false,
|
useColumns: false,
|
||||||
),
|
),
|
||||||
])
|
])
|
||||||
..where(
|
..where(
|
||||||
_db.localAlbumEntity.backupSelection
|
_db.localAlbumEntity.backupSelection.equalsValue(BackupSelection.selected) &
|
||||||
.equalsValue(BackupSelection.selected) &
|
|
||||||
_db.remoteAssetEntity.id.isNotNull() &
|
_db.remoteAssetEntity.id.isNotNull() &
|
||||||
_db.remoteAssetEntity.ownerId.equals(userId) &
|
_db.remoteAssetEntity.ownerId.equals(userId) &
|
||||||
_db.localAlbumAssetEntity.assetId
|
_db.localAlbumAssetEntity.assetId.isNotInQuery(_getExcludedSubquery()),
|
||||||
.isNotInQuery(_getExcludedSubquery()),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return query.get().then((rows) => rows.length);
|
return query.get().then((rows) => rows.length);
|
||||||
@ -122,8 +112,7 @@ class DriftBackupRepository extends DriftDatabaseRepository {
|
|||||||
final selectedAlbumIds = _db.localAlbumEntity.selectOnly(distinct: true)
|
final selectedAlbumIds = _db.localAlbumEntity.selectOnly(distinct: true)
|
||||||
..addColumns([_db.localAlbumEntity.id])
|
..addColumns([_db.localAlbumEntity.id])
|
||||||
..where(
|
..where(
|
||||||
_db.localAlbumEntity.backupSelection
|
_db.localAlbumEntity.backupSelection.equalsValue(BackupSelection.selected),
|
||||||
.equalsValue(BackupSelection.selected),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
final query = _db.localAssetEntity.select()
|
final query = _db.localAssetEntity.select()
|
||||||
@ -133,8 +122,7 @@ class DriftBackupRepository extends DriftDatabaseRepository {
|
|||||||
_db.localAlbumAssetEntity.selectOnly()
|
_db.localAlbumAssetEntity.selectOnly()
|
||||||
..addColumns([_db.localAlbumAssetEntity.assetId])
|
..addColumns([_db.localAlbumAssetEntity.assetId])
|
||||||
..where(
|
..where(
|
||||||
_db.localAlbumAssetEntity.albumId
|
_db.localAlbumAssetEntity.albumId.isInQuery(selectedAlbumIds) &
|
||||||
.isInQuery(selectedAlbumIds) &
|
|
||||||
_db.localAlbumAssetEntity.assetId.equalsExp(lae.id),
|
_db.localAlbumAssetEntity.assetId.equalsExp(lae.id),
|
||||||
),
|
),
|
||||||
) &
|
) &
|
||||||
|
@ -107,8 +107,7 @@ class Drift extends $Drift implements IDatabaseRepository {
|
|||||||
|
|
||||||
if (kDebugMode) {
|
if (kDebugMode) {
|
||||||
// Fail if the migration broke foreign keys
|
// Fail if the migration broke foreign keys
|
||||||
final wrongFKs =
|
final wrongFKs = await customSelect('PRAGMA foreign_key_check').get();
|
||||||
await customSelect('PRAGMA foreign_key_check').get();
|
|
||||||
assert(wrongFKs.isEmpty, '${wrongFKs.map((e) => e.data)}');
|
assert(wrongFKs.isEmpty, '${wrongFKs.map((e) => e.data)}');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,6 +126,5 @@ class DriftDatabaseRepository implements IDatabaseRepository {
|
|||||||
const DriftDatabaseRepository(this._db);
|
const DriftDatabaseRepository(this._db);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<T> transaction<T>(Future<T> Function() callback) =>
|
Future<T> transaction<T>(Future<T> Function() callback) => _db.transaction(callback);
|
||||||
_db.transaction(callback);
|
|
||||||
}
|
}
|
||||||
|
@ -121,13 +121,12 @@ final class Schema2 extends i0.VersionedSchema {
|
|||||||
attachedDatabase: database,
|
attachedDatabase: database,
|
||||||
),
|
),
|
||||||
alias: null);
|
alias: null);
|
||||||
final i1.Index idxLocalAssetChecksum = i1.Index('idx_local_asset_checksum',
|
final i1.Index idxLocalAssetChecksum =
|
||||||
'CREATE INDEX idx_local_asset_checksum ON local_asset_entity (checksum)');
|
i1.Index('idx_local_asset_checksum', 'CREATE INDEX idx_local_asset_checksum ON local_asset_entity (checksum)');
|
||||||
final i1.Index uQRemoteAssetOwnerChecksum = i1.Index(
|
final i1.Index uQRemoteAssetOwnerChecksum = i1.Index('UQ_remote_asset_owner_checksum',
|
||||||
'UQ_remote_asset_owner_checksum',
|
|
||||||
'CREATE UNIQUE INDEX UQ_remote_asset_owner_checksum ON remote_asset_entity (checksum, owner_id)');
|
'CREATE UNIQUE INDEX UQ_remote_asset_owner_checksum ON remote_asset_entity (checksum, owner_id)');
|
||||||
final i1.Index idxRemoteAssetChecksum = i1.Index('idx_remote_asset_checksum',
|
final i1.Index idxRemoteAssetChecksum =
|
||||||
'CREATE INDEX idx_remote_asset_checksum ON remote_asset_entity (checksum)');
|
i1.Index('idx_remote_asset_checksum', 'CREATE INDEX idx_remote_asset_checksum ON remote_asset_entity (checksum)');
|
||||||
late final Shape4 userMetadataEntity = Shape4(
|
late final Shape4 userMetadataEntity = Shape4(
|
||||||
source: i0.VersionedTable(
|
source: i0.VersionedTable(
|
||||||
entityName: 'user_metadata_entity',
|
entityName: 'user_metadata_entity',
|
||||||
@ -350,575 +349,376 @@ final class Schema2 extends i0.VersionedSchema {
|
|||||||
|
|
||||||
class Shape0 extends i0.VersionedTable {
|
class Shape0 extends i0.VersionedTable {
|
||||||
Shape0({required super.source, required super.alias}) : super.aliased();
|
Shape0({required super.source, required super.alias}) : super.aliased();
|
||||||
i1.GeneratedColumn<String> get id =>
|
i1.GeneratedColumn<String> get id => columnsByName['id']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['id']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<String> get name => columnsByName['name']! as i1.GeneratedColumn<String>;
|
||||||
i1.GeneratedColumn<String> get name =>
|
i1.GeneratedColumn<bool> get isAdmin => columnsByName['is_admin']! as i1.GeneratedColumn<bool>;
|
||||||
columnsByName['name']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<String> get email => columnsByName['email']! as i1.GeneratedColumn<String>;
|
||||||
i1.GeneratedColumn<bool> get isAdmin =>
|
i1.GeneratedColumn<String> get profileImagePath => columnsByName['profile_image_path']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['is_admin']! as i1.GeneratedColumn<bool>;
|
i1.GeneratedColumn<DateTime> get updatedAt => columnsByName['updated_at']! as i1.GeneratedColumn<DateTime>;
|
||||||
i1.GeneratedColumn<String> get email =>
|
i1.GeneratedColumn<int> get quotaSizeInBytes => columnsByName['quota_size_in_bytes']! as i1.GeneratedColumn<int>;
|
||||||
columnsByName['email']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<int> get quotaUsageInBytes => columnsByName['quota_usage_in_bytes']! as i1.GeneratedColumn<int>;
|
||||||
i1.GeneratedColumn<String> get profileImagePath =>
|
|
||||||
columnsByName['profile_image_path']! as i1.GeneratedColumn<String>;
|
|
||||||
i1.GeneratedColumn<DateTime> get updatedAt =>
|
|
||||||
columnsByName['updated_at']! as i1.GeneratedColumn<DateTime>;
|
|
||||||
i1.GeneratedColumn<int> get quotaSizeInBytes =>
|
|
||||||
columnsByName['quota_size_in_bytes']! as i1.GeneratedColumn<int>;
|
|
||||||
i1.GeneratedColumn<int> get quotaUsageInBytes =>
|
|
||||||
columnsByName['quota_usage_in_bytes']! as i1.GeneratedColumn<int>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.GeneratedColumn<String> _column_0(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_0(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('id', aliasedName, false,
|
i1.GeneratedColumn<String>('id', aliasedName, false, type: i1.DriftSqlType.string);
|
||||||
type: i1.DriftSqlType.string);
|
|
||||||
i1.GeneratedColumn<String> _column_1(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_1(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('name', aliasedName, false,
|
i1.GeneratedColumn<String>('name', aliasedName, false, type: i1.DriftSqlType.string);
|
||||||
type: i1.DriftSqlType.string);
|
i1.GeneratedColumn<bool> _column_2(String aliasedName) => i1.GeneratedColumn<bool>('is_admin', aliasedName, false,
|
||||||
i1.GeneratedColumn<bool> _column_2(String aliasedName) =>
|
|
||||||
i1.GeneratedColumn<bool>('is_admin', aliasedName, false,
|
|
||||||
type: i1.DriftSqlType.bool,
|
type: i1.DriftSqlType.bool,
|
||||||
defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
|
defaultConstraints: i1.GeneratedColumn.constraintIsAlways('CHECK ("is_admin" IN (0, 1))'),
|
||||||
'CHECK ("is_admin" IN (0, 1))'),
|
|
||||||
defaultValue: const CustomExpression('0'));
|
defaultValue: const CustomExpression('0'));
|
||||||
i1.GeneratedColumn<String> _column_3(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_3(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('email', aliasedName, false,
|
i1.GeneratedColumn<String>('email', aliasedName, false, type: i1.DriftSqlType.string);
|
||||||
type: i1.DriftSqlType.string);
|
|
||||||
i1.GeneratedColumn<String> _column_4(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_4(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('profile_image_path', aliasedName, true,
|
i1.GeneratedColumn<String>('profile_image_path', aliasedName, true, type: i1.DriftSqlType.string);
|
||||||
type: i1.DriftSqlType.string);
|
|
||||||
i1.GeneratedColumn<DateTime> _column_5(String aliasedName) =>
|
i1.GeneratedColumn<DateTime> _column_5(String aliasedName) =>
|
||||||
i1.GeneratedColumn<DateTime>('updated_at', aliasedName, false,
|
i1.GeneratedColumn<DateTime>('updated_at', aliasedName, false,
|
||||||
type: i1.DriftSqlType.dateTime,
|
type: i1.DriftSqlType.dateTime, defaultValue: const CustomExpression('CURRENT_TIMESTAMP'));
|
||||||
defaultValue: const CustomExpression('CURRENT_TIMESTAMP'));
|
|
||||||
i1.GeneratedColumn<int> _column_6(String aliasedName) =>
|
i1.GeneratedColumn<int> _column_6(String aliasedName) =>
|
||||||
i1.GeneratedColumn<int>('quota_size_in_bytes', aliasedName, true,
|
i1.GeneratedColumn<int>('quota_size_in_bytes', aliasedName, true, type: i1.DriftSqlType.int);
|
||||||
type: i1.DriftSqlType.int);
|
|
||||||
i1.GeneratedColumn<int> _column_7(String aliasedName) =>
|
i1.GeneratedColumn<int> _column_7(String aliasedName) =>
|
||||||
i1.GeneratedColumn<int>('quota_usage_in_bytes', aliasedName, false,
|
i1.GeneratedColumn<int>('quota_usage_in_bytes', aliasedName, false,
|
||||||
type: i1.DriftSqlType.int, defaultValue: const CustomExpression('0'));
|
type: i1.DriftSqlType.int, defaultValue: const CustomExpression('0'));
|
||||||
|
|
||||||
class Shape1 extends i0.VersionedTable {
|
class Shape1 extends i0.VersionedTable {
|
||||||
Shape1({required super.source, required super.alias}) : super.aliased();
|
Shape1({required super.source, required super.alias}) : super.aliased();
|
||||||
i1.GeneratedColumn<String> get name =>
|
i1.GeneratedColumn<String> get name => columnsByName['name']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['name']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<int> get type => columnsByName['type']! as i1.GeneratedColumn<int>;
|
||||||
i1.GeneratedColumn<int> get type =>
|
i1.GeneratedColumn<DateTime> get createdAt => columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
|
||||||
columnsByName['type']! as i1.GeneratedColumn<int>;
|
i1.GeneratedColumn<DateTime> get updatedAt => columnsByName['updated_at']! as i1.GeneratedColumn<DateTime>;
|
||||||
i1.GeneratedColumn<DateTime> get createdAt =>
|
i1.GeneratedColumn<int> get width => columnsByName['width']! as i1.GeneratedColumn<int>;
|
||||||
columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
|
i1.GeneratedColumn<int> get height => columnsByName['height']! as i1.GeneratedColumn<int>;
|
||||||
i1.GeneratedColumn<DateTime> get updatedAt =>
|
i1.GeneratedColumn<int> get durationInSeconds => columnsByName['duration_in_seconds']! as i1.GeneratedColumn<int>;
|
||||||
columnsByName['updated_at']! as i1.GeneratedColumn<DateTime>;
|
i1.GeneratedColumn<String> get id => columnsByName['id']! as i1.GeneratedColumn<String>;
|
||||||
i1.GeneratedColumn<int> get width =>
|
i1.GeneratedColumn<String> get checksum => columnsByName['checksum']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['width']! as i1.GeneratedColumn<int>;
|
i1.GeneratedColumn<bool> get isFavorite => columnsByName['is_favorite']! as i1.GeneratedColumn<bool>;
|
||||||
i1.GeneratedColumn<int> get height =>
|
i1.GeneratedColumn<String> get ownerId => columnsByName['owner_id']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['height']! as i1.GeneratedColumn<int>;
|
i1.GeneratedColumn<DateTime> get localDateTime => columnsByName['local_date_time']! as i1.GeneratedColumn<DateTime>;
|
||||||
i1.GeneratedColumn<int> get durationInSeconds =>
|
i1.GeneratedColumn<String> get thumbHash => columnsByName['thumb_hash']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['duration_in_seconds']! as i1.GeneratedColumn<int>;
|
i1.GeneratedColumn<DateTime> get deletedAt => columnsByName['deleted_at']! as i1.GeneratedColumn<DateTime>;
|
||||||
i1.GeneratedColumn<String> get id =>
|
|
||||||
columnsByName['id']! as i1.GeneratedColumn<String>;
|
|
||||||
i1.GeneratedColumn<String> get checksum =>
|
|
||||||
columnsByName['checksum']! as i1.GeneratedColumn<String>;
|
|
||||||
i1.GeneratedColumn<bool> get isFavorite =>
|
|
||||||
columnsByName['is_favorite']! as i1.GeneratedColumn<bool>;
|
|
||||||
i1.GeneratedColumn<String> get ownerId =>
|
|
||||||
columnsByName['owner_id']! as i1.GeneratedColumn<String>;
|
|
||||||
i1.GeneratedColumn<DateTime> get localDateTime =>
|
|
||||||
columnsByName['local_date_time']! as i1.GeneratedColumn<DateTime>;
|
|
||||||
i1.GeneratedColumn<String> get thumbHash =>
|
|
||||||
columnsByName['thumb_hash']! as i1.GeneratedColumn<String>;
|
|
||||||
i1.GeneratedColumn<DateTime> get deletedAt =>
|
|
||||||
columnsByName['deleted_at']! as i1.GeneratedColumn<DateTime>;
|
|
||||||
i1.GeneratedColumn<String> get livePhotoVideoId =>
|
i1.GeneratedColumn<String> get livePhotoVideoId =>
|
||||||
columnsByName['live_photo_video_id']! as i1.GeneratedColumn<String>;
|
columnsByName['live_photo_video_id']! as i1.GeneratedColumn<String>;
|
||||||
i1.GeneratedColumn<int> get visibility =>
|
i1.GeneratedColumn<int> get visibility => columnsByName['visibility']! as i1.GeneratedColumn<int>;
|
||||||
columnsByName['visibility']! as i1.GeneratedColumn<int>;
|
i1.GeneratedColumn<String> get stackId => columnsByName['stack_id']! as i1.GeneratedColumn<String>;
|
||||||
i1.GeneratedColumn<String> get stackId =>
|
|
||||||
columnsByName['stack_id']! as i1.GeneratedColumn<String>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.GeneratedColumn<int> _column_8(String aliasedName) =>
|
i1.GeneratedColumn<int> _column_8(String aliasedName) =>
|
||||||
i1.GeneratedColumn<int>('type', aliasedName, false,
|
i1.GeneratedColumn<int>('type', aliasedName, false, type: i1.DriftSqlType.int);
|
||||||
type: i1.DriftSqlType.int);
|
|
||||||
i1.GeneratedColumn<DateTime> _column_9(String aliasedName) =>
|
i1.GeneratedColumn<DateTime> _column_9(String aliasedName) =>
|
||||||
i1.GeneratedColumn<DateTime>('created_at', aliasedName, false,
|
i1.GeneratedColumn<DateTime>('created_at', aliasedName, false,
|
||||||
type: i1.DriftSqlType.dateTime,
|
type: i1.DriftSqlType.dateTime, defaultValue: const CustomExpression('CURRENT_TIMESTAMP'));
|
||||||
defaultValue: const CustomExpression('CURRENT_TIMESTAMP'));
|
|
||||||
i1.GeneratedColumn<int> _column_10(String aliasedName) =>
|
i1.GeneratedColumn<int> _column_10(String aliasedName) =>
|
||||||
i1.GeneratedColumn<int>('width', aliasedName, true,
|
i1.GeneratedColumn<int>('width', aliasedName, true, type: i1.DriftSqlType.int);
|
||||||
type: i1.DriftSqlType.int);
|
|
||||||
i1.GeneratedColumn<int> _column_11(String aliasedName) =>
|
i1.GeneratedColumn<int> _column_11(String aliasedName) =>
|
||||||
i1.GeneratedColumn<int>('height', aliasedName, true,
|
i1.GeneratedColumn<int>('height', aliasedName, true, type: i1.DriftSqlType.int);
|
||||||
type: i1.DriftSqlType.int);
|
|
||||||
i1.GeneratedColumn<int> _column_12(String aliasedName) =>
|
i1.GeneratedColumn<int> _column_12(String aliasedName) =>
|
||||||
i1.GeneratedColumn<int>('duration_in_seconds', aliasedName, true,
|
i1.GeneratedColumn<int>('duration_in_seconds', aliasedName, true, type: i1.DriftSqlType.int);
|
||||||
type: i1.DriftSqlType.int);
|
|
||||||
i1.GeneratedColumn<String> _column_13(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_13(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('checksum', aliasedName, false,
|
i1.GeneratedColumn<String>('checksum', aliasedName, false, type: i1.DriftSqlType.string);
|
||||||
type: i1.DriftSqlType.string);
|
i1.GeneratedColumn<bool> _column_14(String aliasedName) => i1.GeneratedColumn<bool>('is_favorite', aliasedName, false,
|
||||||
i1.GeneratedColumn<bool> _column_14(String aliasedName) =>
|
|
||||||
i1.GeneratedColumn<bool>('is_favorite', aliasedName, false,
|
|
||||||
type: i1.DriftSqlType.bool,
|
type: i1.DriftSqlType.bool,
|
||||||
defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
|
defaultConstraints: i1.GeneratedColumn.constraintIsAlways('CHECK ("is_favorite" IN (0, 1))'),
|
||||||
'CHECK ("is_favorite" IN (0, 1))'),
|
|
||||||
defaultValue: const CustomExpression('0'));
|
defaultValue: const CustomExpression('0'));
|
||||||
i1.GeneratedColumn<String> _column_15(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_15(String aliasedName) => i1.GeneratedColumn<String>('owner_id', aliasedName, false,
|
||||||
i1.GeneratedColumn<String>('owner_id', aliasedName, false,
|
|
||||||
type: i1.DriftSqlType.string,
|
type: i1.DriftSqlType.string,
|
||||||
defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
|
defaultConstraints: i1.GeneratedColumn.constraintIsAlways('REFERENCES user_entity (id) ON DELETE CASCADE'));
|
||||||
'REFERENCES user_entity (id) ON DELETE CASCADE'));
|
|
||||||
i1.GeneratedColumn<DateTime> _column_16(String aliasedName) =>
|
i1.GeneratedColumn<DateTime> _column_16(String aliasedName) =>
|
||||||
i1.GeneratedColumn<DateTime>('local_date_time', aliasedName, true,
|
i1.GeneratedColumn<DateTime>('local_date_time', aliasedName, true, type: i1.DriftSqlType.dateTime);
|
||||||
type: i1.DriftSqlType.dateTime);
|
|
||||||
i1.GeneratedColumn<String> _column_17(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_17(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('thumb_hash', aliasedName, true,
|
i1.GeneratedColumn<String>('thumb_hash', aliasedName, true, type: i1.DriftSqlType.string);
|
||||||
type: i1.DriftSqlType.string);
|
|
||||||
i1.GeneratedColumn<DateTime> _column_18(String aliasedName) =>
|
i1.GeneratedColumn<DateTime> _column_18(String aliasedName) =>
|
||||||
i1.GeneratedColumn<DateTime>('deleted_at', aliasedName, true,
|
i1.GeneratedColumn<DateTime>('deleted_at', aliasedName, true, type: i1.DriftSqlType.dateTime);
|
||||||
type: i1.DriftSqlType.dateTime);
|
|
||||||
i1.GeneratedColumn<String> _column_19(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_19(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('live_photo_video_id', aliasedName, true,
|
i1.GeneratedColumn<String>('live_photo_video_id', aliasedName, true, type: i1.DriftSqlType.string);
|
||||||
type: i1.DriftSqlType.string);
|
|
||||||
i1.GeneratedColumn<int> _column_20(String aliasedName) =>
|
i1.GeneratedColumn<int> _column_20(String aliasedName) =>
|
||||||
i1.GeneratedColumn<int>('visibility', aliasedName, false,
|
i1.GeneratedColumn<int>('visibility', aliasedName, false, type: i1.DriftSqlType.int);
|
||||||
type: i1.DriftSqlType.int);
|
|
||||||
i1.GeneratedColumn<String> _column_21(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_21(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('stack_id', aliasedName, true,
|
i1.GeneratedColumn<String>('stack_id', aliasedName, true, type: i1.DriftSqlType.string);
|
||||||
type: i1.DriftSqlType.string);
|
|
||||||
|
|
||||||
class Shape2 extends i0.VersionedTable {
|
class Shape2 extends i0.VersionedTable {
|
||||||
Shape2({required super.source, required super.alias}) : super.aliased();
|
Shape2({required super.source, required super.alias}) : super.aliased();
|
||||||
i1.GeneratedColumn<String> get name =>
|
i1.GeneratedColumn<String> get name => columnsByName['name']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['name']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<int> get type => columnsByName['type']! as i1.GeneratedColumn<int>;
|
||||||
i1.GeneratedColumn<int> get type =>
|
i1.GeneratedColumn<DateTime> get createdAt => columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
|
||||||
columnsByName['type']! as i1.GeneratedColumn<int>;
|
i1.GeneratedColumn<DateTime> get updatedAt => columnsByName['updated_at']! as i1.GeneratedColumn<DateTime>;
|
||||||
i1.GeneratedColumn<DateTime> get createdAt =>
|
i1.GeneratedColumn<int> get width => columnsByName['width']! as i1.GeneratedColumn<int>;
|
||||||
columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
|
i1.GeneratedColumn<int> get height => columnsByName['height']! as i1.GeneratedColumn<int>;
|
||||||
i1.GeneratedColumn<DateTime> get updatedAt =>
|
i1.GeneratedColumn<int> get durationInSeconds => columnsByName['duration_in_seconds']! as i1.GeneratedColumn<int>;
|
||||||
columnsByName['updated_at']! as i1.GeneratedColumn<DateTime>;
|
i1.GeneratedColumn<String> get id => columnsByName['id']! as i1.GeneratedColumn<String>;
|
||||||
i1.GeneratedColumn<int> get width =>
|
i1.GeneratedColumn<String> get checksum => columnsByName['checksum']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['width']! as i1.GeneratedColumn<int>;
|
i1.GeneratedColumn<bool> get isFavorite => columnsByName['is_favorite']! as i1.GeneratedColumn<bool>;
|
||||||
i1.GeneratedColumn<int> get height =>
|
i1.GeneratedColumn<int> get orientation => columnsByName['orientation']! as i1.GeneratedColumn<int>;
|
||||||
columnsByName['height']! as i1.GeneratedColumn<int>;
|
|
||||||
i1.GeneratedColumn<int> get durationInSeconds =>
|
|
||||||
columnsByName['duration_in_seconds']! as i1.GeneratedColumn<int>;
|
|
||||||
i1.GeneratedColumn<String> get id =>
|
|
||||||
columnsByName['id']! as i1.GeneratedColumn<String>;
|
|
||||||
i1.GeneratedColumn<String> get checksum =>
|
|
||||||
columnsByName['checksum']! as i1.GeneratedColumn<String>;
|
|
||||||
i1.GeneratedColumn<bool> get isFavorite =>
|
|
||||||
columnsByName['is_favorite']! as i1.GeneratedColumn<bool>;
|
|
||||||
i1.GeneratedColumn<int> get orientation =>
|
|
||||||
columnsByName['orientation']! as i1.GeneratedColumn<int>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.GeneratedColumn<String> _column_22(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_22(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('checksum', aliasedName, true,
|
i1.GeneratedColumn<String>('checksum', aliasedName, true, type: i1.DriftSqlType.string);
|
||||||
type: i1.DriftSqlType.string);
|
i1.GeneratedColumn<int> _column_23(String aliasedName) => i1.GeneratedColumn<int>('orientation', aliasedName, false,
|
||||||
i1.GeneratedColumn<int> _column_23(String aliasedName) =>
|
|
||||||
i1.GeneratedColumn<int>('orientation', aliasedName, false,
|
|
||||||
type: i1.DriftSqlType.int, defaultValue: const CustomExpression('0'));
|
type: i1.DriftSqlType.int, defaultValue: const CustomExpression('0'));
|
||||||
|
|
||||||
class Shape3 extends i0.VersionedTable {
|
class Shape3 extends i0.VersionedTable {
|
||||||
Shape3({required super.source, required super.alias}) : super.aliased();
|
Shape3({required super.source, required super.alias}) : super.aliased();
|
||||||
i1.GeneratedColumn<String> get id =>
|
i1.GeneratedColumn<String> get id => columnsByName['id']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['id']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<DateTime> get createdAt => columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
|
||||||
i1.GeneratedColumn<DateTime> get createdAt =>
|
i1.GeneratedColumn<DateTime> get updatedAt => columnsByName['updated_at']! as i1.GeneratedColumn<DateTime>;
|
||||||
columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
|
i1.GeneratedColumn<String> get ownerId => columnsByName['owner_id']! as i1.GeneratedColumn<String>;
|
||||||
i1.GeneratedColumn<DateTime> get updatedAt =>
|
i1.GeneratedColumn<String> get primaryAssetId => columnsByName['primary_asset_id']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['updated_at']! as i1.GeneratedColumn<DateTime>;
|
|
||||||
i1.GeneratedColumn<String> get ownerId =>
|
|
||||||
columnsByName['owner_id']! as i1.GeneratedColumn<String>;
|
|
||||||
i1.GeneratedColumn<String> get primaryAssetId =>
|
|
||||||
columnsByName['primary_asset_id']! as i1.GeneratedColumn<String>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.GeneratedColumn<String> _column_24(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_24(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('primary_asset_id', aliasedName, false,
|
i1.GeneratedColumn<String>('primary_asset_id', aliasedName, false,
|
||||||
type: i1.DriftSqlType.string,
|
type: i1.DriftSqlType.string,
|
||||||
defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
|
defaultConstraints: i1.GeneratedColumn.constraintIsAlways('REFERENCES remote_asset_entity (id)'));
|
||||||
'REFERENCES remote_asset_entity (id)'));
|
|
||||||
|
|
||||||
class Shape4 extends i0.VersionedTable {
|
class Shape4 extends i0.VersionedTable {
|
||||||
Shape4({required super.source, required super.alias}) : super.aliased();
|
Shape4({required super.source, required super.alias}) : super.aliased();
|
||||||
i1.GeneratedColumn<String> get userId =>
|
i1.GeneratedColumn<String> get userId => columnsByName['user_id']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['user_id']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<int> get key => columnsByName['key']! as i1.GeneratedColumn<int>;
|
||||||
i1.GeneratedColumn<int> get key =>
|
i1.GeneratedColumn<i2.Uint8List> get value => columnsByName['value']! as i1.GeneratedColumn<i2.Uint8List>;
|
||||||
columnsByName['key']! as i1.GeneratedColumn<int>;
|
|
||||||
i1.GeneratedColumn<i2.Uint8List> get value =>
|
|
||||||
columnsByName['value']! as i1.GeneratedColumn<i2.Uint8List>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.GeneratedColumn<String> _column_25(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_25(String aliasedName) => i1.GeneratedColumn<String>('user_id', aliasedName, false,
|
||||||
i1.GeneratedColumn<String>('user_id', aliasedName, false,
|
|
||||||
type: i1.DriftSqlType.string,
|
type: i1.DriftSqlType.string,
|
||||||
defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
|
defaultConstraints: i1.GeneratedColumn.constraintIsAlways('REFERENCES user_entity (id) ON DELETE CASCADE'));
|
||||||
'REFERENCES user_entity (id) ON DELETE CASCADE'));
|
|
||||||
i1.GeneratedColumn<int> _column_26(String aliasedName) =>
|
i1.GeneratedColumn<int> _column_26(String aliasedName) =>
|
||||||
i1.GeneratedColumn<int>('key', aliasedName, false,
|
i1.GeneratedColumn<int>('key', aliasedName, false, type: i1.DriftSqlType.int);
|
||||||
type: i1.DriftSqlType.int);
|
|
||||||
i1.GeneratedColumn<i2.Uint8List> _column_27(String aliasedName) =>
|
i1.GeneratedColumn<i2.Uint8List> _column_27(String aliasedName) =>
|
||||||
i1.GeneratedColumn<i2.Uint8List>('value', aliasedName, false,
|
i1.GeneratedColumn<i2.Uint8List>('value', aliasedName, false, type: i1.DriftSqlType.blob);
|
||||||
type: i1.DriftSqlType.blob);
|
|
||||||
|
|
||||||
class Shape5 extends i0.VersionedTable {
|
class Shape5 extends i0.VersionedTable {
|
||||||
Shape5({required super.source, required super.alias}) : super.aliased();
|
Shape5({required super.source, required super.alias}) : super.aliased();
|
||||||
i1.GeneratedColumn<String> get sharedById =>
|
i1.GeneratedColumn<String> get sharedById => columnsByName['shared_by_id']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['shared_by_id']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<String> get sharedWithId => columnsByName['shared_with_id']! as i1.GeneratedColumn<String>;
|
||||||
i1.GeneratedColumn<String> get sharedWithId =>
|
i1.GeneratedColumn<bool> get inTimeline => columnsByName['in_timeline']! as i1.GeneratedColumn<bool>;
|
||||||
columnsByName['shared_with_id']! as i1.GeneratedColumn<String>;
|
|
||||||
i1.GeneratedColumn<bool> get inTimeline =>
|
|
||||||
columnsByName['in_timeline']! as i1.GeneratedColumn<bool>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.GeneratedColumn<String> _column_28(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_28(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('shared_by_id', aliasedName, false,
|
i1.GeneratedColumn<String>('shared_by_id', aliasedName, false,
|
||||||
type: i1.DriftSqlType.string,
|
type: i1.DriftSqlType.string,
|
||||||
defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
|
defaultConstraints: i1.GeneratedColumn.constraintIsAlways('REFERENCES user_entity (id) ON DELETE CASCADE'));
|
||||||
'REFERENCES user_entity (id) ON DELETE CASCADE'));
|
|
||||||
i1.GeneratedColumn<String> _column_29(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_29(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('shared_with_id', aliasedName, false,
|
i1.GeneratedColumn<String>('shared_with_id', aliasedName, false,
|
||||||
type: i1.DriftSqlType.string,
|
type: i1.DriftSqlType.string,
|
||||||
defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
|
defaultConstraints: i1.GeneratedColumn.constraintIsAlways('REFERENCES user_entity (id) ON DELETE CASCADE'));
|
||||||
'REFERENCES user_entity (id) ON DELETE CASCADE'));
|
i1.GeneratedColumn<bool> _column_30(String aliasedName) => i1.GeneratedColumn<bool>('in_timeline', aliasedName, false,
|
||||||
i1.GeneratedColumn<bool> _column_30(String aliasedName) =>
|
|
||||||
i1.GeneratedColumn<bool>('in_timeline', aliasedName, false,
|
|
||||||
type: i1.DriftSqlType.bool,
|
type: i1.DriftSqlType.bool,
|
||||||
defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
|
defaultConstraints: i1.GeneratedColumn.constraintIsAlways('CHECK ("in_timeline" IN (0, 1))'),
|
||||||
'CHECK ("in_timeline" IN (0, 1))'),
|
|
||||||
defaultValue: const CustomExpression('0'));
|
defaultValue: const CustomExpression('0'));
|
||||||
|
|
||||||
class Shape6 extends i0.VersionedTable {
|
class Shape6 extends i0.VersionedTable {
|
||||||
Shape6({required super.source, required super.alias}) : super.aliased();
|
Shape6({required super.source, required super.alias}) : super.aliased();
|
||||||
i1.GeneratedColumn<String> get id =>
|
i1.GeneratedColumn<String> get id => columnsByName['id']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['id']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<String> get name => columnsByName['name']! as i1.GeneratedColumn<String>;
|
||||||
i1.GeneratedColumn<String> get name =>
|
i1.GeneratedColumn<DateTime> get updatedAt => columnsByName['updated_at']! as i1.GeneratedColumn<DateTime>;
|
||||||
columnsByName['name']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<int> get backupSelection => columnsByName['backup_selection']! as i1.GeneratedColumn<int>;
|
||||||
i1.GeneratedColumn<DateTime> get updatedAt =>
|
i1.GeneratedColumn<bool> get isIosSharedAlbum => columnsByName['is_ios_shared_album']! as i1.GeneratedColumn<bool>;
|
||||||
columnsByName['updated_at']! as i1.GeneratedColumn<DateTime>;
|
i1.GeneratedColumn<bool> get marker_ => columnsByName['marker']! as i1.GeneratedColumn<bool>;
|
||||||
i1.GeneratedColumn<int> get backupSelection =>
|
|
||||||
columnsByName['backup_selection']! as i1.GeneratedColumn<int>;
|
|
||||||
i1.GeneratedColumn<bool> get isIosSharedAlbum =>
|
|
||||||
columnsByName['is_ios_shared_album']! as i1.GeneratedColumn<bool>;
|
|
||||||
i1.GeneratedColumn<bool> get marker_ =>
|
|
||||||
columnsByName['marker']! as i1.GeneratedColumn<bool>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.GeneratedColumn<int> _column_31(String aliasedName) =>
|
i1.GeneratedColumn<int> _column_31(String aliasedName) =>
|
||||||
i1.GeneratedColumn<int>('backup_selection', aliasedName, false,
|
i1.GeneratedColumn<int>('backup_selection', aliasedName, false, type: i1.DriftSqlType.int);
|
||||||
type: i1.DriftSqlType.int);
|
|
||||||
i1.GeneratedColumn<bool> _column_32(String aliasedName) =>
|
i1.GeneratedColumn<bool> _column_32(String aliasedName) =>
|
||||||
i1.GeneratedColumn<bool>('is_ios_shared_album', aliasedName, false,
|
i1.GeneratedColumn<bool>('is_ios_shared_album', aliasedName, false,
|
||||||
type: i1.DriftSqlType.bool,
|
type: i1.DriftSqlType.bool,
|
||||||
defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
|
defaultConstraints: i1.GeneratedColumn.constraintIsAlways('CHECK ("is_ios_shared_album" IN (0, 1))'),
|
||||||
'CHECK ("is_ios_shared_album" IN (0, 1))'),
|
|
||||||
defaultValue: const CustomExpression('0'));
|
defaultValue: const CustomExpression('0'));
|
||||||
i1.GeneratedColumn<bool> _column_33(String aliasedName) =>
|
i1.GeneratedColumn<bool> _column_33(String aliasedName) => i1.GeneratedColumn<bool>('marker', aliasedName, true,
|
||||||
i1.GeneratedColumn<bool>('marker', aliasedName, true,
|
|
||||||
type: i1.DriftSqlType.bool,
|
type: i1.DriftSqlType.bool,
|
||||||
defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
|
defaultConstraints: i1.GeneratedColumn.constraintIsAlways('CHECK ("marker" IN (0, 1))'));
|
||||||
'CHECK ("marker" IN (0, 1))'));
|
|
||||||
|
|
||||||
class Shape7 extends i0.VersionedTable {
|
class Shape7 extends i0.VersionedTable {
|
||||||
Shape7({required super.source, required super.alias}) : super.aliased();
|
Shape7({required super.source, required super.alias}) : super.aliased();
|
||||||
i1.GeneratedColumn<String> get assetId =>
|
i1.GeneratedColumn<String> get assetId => columnsByName['asset_id']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['asset_id']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<String> get albumId => columnsByName['album_id']! as i1.GeneratedColumn<String>;
|
||||||
i1.GeneratedColumn<String> get albumId =>
|
|
||||||
columnsByName['album_id']! as i1.GeneratedColumn<String>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.GeneratedColumn<String> _column_34(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_34(String aliasedName) => i1.GeneratedColumn<String>('asset_id', aliasedName, false,
|
||||||
i1.GeneratedColumn<String>('asset_id', aliasedName, false,
|
|
||||||
type: i1.DriftSqlType.string,
|
type: i1.DriftSqlType.string,
|
||||||
defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
|
defaultConstraints: i1.GeneratedColumn.constraintIsAlways('REFERENCES local_asset_entity (id) ON DELETE CASCADE'));
|
||||||
'REFERENCES local_asset_entity (id) ON DELETE CASCADE'));
|
i1.GeneratedColumn<String> _column_35(String aliasedName) => i1.GeneratedColumn<String>('album_id', aliasedName, false,
|
||||||
i1.GeneratedColumn<String> _column_35(String aliasedName) =>
|
|
||||||
i1.GeneratedColumn<String>('album_id', aliasedName, false,
|
|
||||||
type: i1.DriftSqlType.string,
|
type: i1.DriftSqlType.string,
|
||||||
defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
|
defaultConstraints: i1.GeneratedColumn.constraintIsAlways('REFERENCES local_album_entity (id) ON DELETE CASCADE'));
|
||||||
'REFERENCES local_album_entity (id) ON DELETE CASCADE'));
|
|
||||||
|
|
||||||
class Shape8 extends i0.VersionedTable {
|
class Shape8 extends i0.VersionedTable {
|
||||||
Shape8({required super.source, required super.alias}) : super.aliased();
|
Shape8({required super.source, required super.alias}) : super.aliased();
|
||||||
i1.GeneratedColumn<String> get assetId =>
|
i1.GeneratedColumn<String> get assetId => columnsByName['asset_id']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['asset_id']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<String> get city => columnsByName['city']! as i1.GeneratedColumn<String>;
|
||||||
i1.GeneratedColumn<String> get city =>
|
i1.GeneratedColumn<String> get state => columnsByName['state']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['city']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<String> get country => columnsByName['country']! as i1.GeneratedColumn<String>;
|
||||||
i1.GeneratedColumn<String> get state =>
|
|
||||||
columnsByName['state']! as i1.GeneratedColumn<String>;
|
|
||||||
i1.GeneratedColumn<String> get country =>
|
|
||||||
columnsByName['country']! as i1.GeneratedColumn<String>;
|
|
||||||
i1.GeneratedColumn<DateTime> get dateTimeOriginal =>
|
i1.GeneratedColumn<DateTime> get dateTimeOriginal =>
|
||||||
columnsByName['date_time_original']! as i1.GeneratedColumn<DateTime>;
|
columnsByName['date_time_original']! as i1.GeneratedColumn<DateTime>;
|
||||||
i1.GeneratedColumn<String> get description =>
|
i1.GeneratedColumn<String> get description => columnsByName['description']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['description']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<int> get height => columnsByName['height']! as i1.GeneratedColumn<int>;
|
||||||
i1.GeneratedColumn<int> get height =>
|
i1.GeneratedColumn<int> get width => columnsByName['width']! as i1.GeneratedColumn<int>;
|
||||||
columnsByName['height']! as i1.GeneratedColumn<int>;
|
i1.GeneratedColumn<String> get exposureTime => columnsByName['exposure_time']! as i1.GeneratedColumn<String>;
|
||||||
i1.GeneratedColumn<int> get width =>
|
i1.GeneratedColumn<double> get fNumber => columnsByName['f_number']! as i1.GeneratedColumn<double>;
|
||||||
columnsByName['width']! as i1.GeneratedColumn<int>;
|
i1.GeneratedColumn<int> get fileSize => columnsByName['file_size']! as i1.GeneratedColumn<int>;
|
||||||
i1.GeneratedColumn<String> get exposureTime =>
|
i1.GeneratedColumn<double> get focalLength => columnsByName['focal_length']! as i1.GeneratedColumn<double>;
|
||||||
columnsByName['exposure_time']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<double> get latitude => columnsByName['latitude']! as i1.GeneratedColumn<double>;
|
||||||
i1.GeneratedColumn<double> get fNumber =>
|
i1.GeneratedColumn<double> get longitude => columnsByName['longitude']! as i1.GeneratedColumn<double>;
|
||||||
columnsByName['f_number']! as i1.GeneratedColumn<double>;
|
i1.GeneratedColumn<int> get iso => columnsByName['iso']! as i1.GeneratedColumn<int>;
|
||||||
i1.GeneratedColumn<int> get fileSize =>
|
i1.GeneratedColumn<String> get make => columnsByName['make']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['file_size']! as i1.GeneratedColumn<int>;
|
i1.GeneratedColumn<String> get model => columnsByName['model']! as i1.GeneratedColumn<String>;
|
||||||
i1.GeneratedColumn<double> get focalLength =>
|
i1.GeneratedColumn<String> get lens => columnsByName['lens']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['focal_length']! as i1.GeneratedColumn<double>;
|
i1.GeneratedColumn<String> get orientation => columnsByName['orientation']! as i1.GeneratedColumn<String>;
|
||||||
i1.GeneratedColumn<double> get latitude =>
|
i1.GeneratedColumn<String> get timeZone => columnsByName['time_zone']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['latitude']! as i1.GeneratedColumn<double>;
|
i1.GeneratedColumn<int> get rating => columnsByName['rating']! as i1.GeneratedColumn<int>;
|
||||||
i1.GeneratedColumn<double> get longitude =>
|
i1.GeneratedColumn<String> get projectionType => columnsByName['projection_type']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['longitude']! as i1.GeneratedColumn<double>;
|
|
||||||
i1.GeneratedColumn<int> get iso =>
|
|
||||||
columnsByName['iso']! as i1.GeneratedColumn<int>;
|
|
||||||
i1.GeneratedColumn<String> get make =>
|
|
||||||
columnsByName['make']! as i1.GeneratedColumn<String>;
|
|
||||||
i1.GeneratedColumn<String> get model =>
|
|
||||||
columnsByName['model']! as i1.GeneratedColumn<String>;
|
|
||||||
i1.GeneratedColumn<String> get lens =>
|
|
||||||
columnsByName['lens']! as i1.GeneratedColumn<String>;
|
|
||||||
i1.GeneratedColumn<String> get orientation =>
|
|
||||||
columnsByName['orientation']! as i1.GeneratedColumn<String>;
|
|
||||||
i1.GeneratedColumn<String> get timeZone =>
|
|
||||||
columnsByName['time_zone']! as i1.GeneratedColumn<String>;
|
|
||||||
i1.GeneratedColumn<int> get rating =>
|
|
||||||
columnsByName['rating']! as i1.GeneratedColumn<int>;
|
|
||||||
i1.GeneratedColumn<String> get projectionType =>
|
|
||||||
columnsByName['projection_type']! as i1.GeneratedColumn<String>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.GeneratedColumn<String> _column_36(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_36(String aliasedName) => i1.GeneratedColumn<String>('asset_id', aliasedName, false,
|
||||||
i1.GeneratedColumn<String>('asset_id', aliasedName, false,
|
|
||||||
type: i1.DriftSqlType.string,
|
type: i1.DriftSqlType.string,
|
||||||
defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
|
defaultConstraints: i1.GeneratedColumn.constraintIsAlways('REFERENCES remote_asset_entity (id) ON DELETE CASCADE'));
|
||||||
'REFERENCES remote_asset_entity (id) ON DELETE CASCADE'));
|
|
||||||
i1.GeneratedColumn<String> _column_37(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_37(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('city', aliasedName, true,
|
i1.GeneratedColumn<String>('city', aliasedName, true, type: i1.DriftSqlType.string);
|
||||||
type: i1.DriftSqlType.string);
|
|
||||||
i1.GeneratedColumn<String> _column_38(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_38(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('state', aliasedName, true,
|
i1.GeneratedColumn<String>('state', aliasedName, true, type: i1.DriftSqlType.string);
|
||||||
type: i1.DriftSqlType.string);
|
|
||||||
i1.GeneratedColumn<String> _column_39(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_39(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('country', aliasedName, true,
|
i1.GeneratedColumn<String>('country', aliasedName, true, type: i1.DriftSqlType.string);
|
||||||
type: i1.DriftSqlType.string);
|
|
||||||
i1.GeneratedColumn<DateTime> _column_40(String aliasedName) =>
|
i1.GeneratedColumn<DateTime> _column_40(String aliasedName) =>
|
||||||
i1.GeneratedColumn<DateTime>('date_time_original', aliasedName, true,
|
i1.GeneratedColumn<DateTime>('date_time_original', aliasedName, true, type: i1.DriftSqlType.dateTime);
|
||||||
type: i1.DriftSqlType.dateTime);
|
|
||||||
i1.GeneratedColumn<String> _column_41(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_41(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('description', aliasedName, true,
|
i1.GeneratedColumn<String>('description', aliasedName, true, type: i1.DriftSqlType.string);
|
||||||
type: i1.DriftSqlType.string);
|
|
||||||
i1.GeneratedColumn<String> _column_42(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_42(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('exposure_time', aliasedName, true,
|
i1.GeneratedColumn<String>('exposure_time', aliasedName, true, type: i1.DriftSqlType.string);
|
||||||
type: i1.DriftSqlType.string);
|
|
||||||
i1.GeneratedColumn<double> _column_43(String aliasedName) =>
|
i1.GeneratedColumn<double> _column_43(String aliasedName) =>
|
||||||
i1.GeneratedColumn<double>('f_number', aliasedName, true,
|
i1.GeneratedColumn<double>('f_number', aliasedName, true, type: i1.DriftSqlType.double);
|
||||||
type: i1.DriftSqlType.double);
|
|
||||||
i1.GeneratedColumn<int> _column_44(String aliasedName) =>
|
i1.GeneratedColumn<int> _column_44(String aliasedName) =>
|
||||||
i1.GeneratedColumn<int>('file_size', aliasedName, true,
|
i1.GeneratedColumn<int>('file_size', aliasedName, true, type: i1.DriftSqlType.int);
|
||||||
type: i1.DriftSqlType.int);
|
|
||||||
i1.GeneratedColumn<double> _column_45(String aliasedName) =>
|
i1.GeneratedColumn<double> _column_45(String aliasedName) =>
|
||||||
i1.GeneratedColumn<double>('focal_length', aliasedName, true,
|
i1.GeneratedColumn<double>('focal_length', aliasedName, true, type: i1.DriftSqlType.double);
|
||||||
type: i1.DriftSqlType.double);
|
|
||||||
i1.GeneratedColumn<double> _column_46(String aliasedName) =>
|
i1.GeneratedColumn<double> _column_46(String aliasedName) =>
|
||||||
i1.GeneratedColumn<double>('latitude', aliasedName, true,
|
i1.GeneratedColumn<double>('latitude', aliasedName, true, type: i1.DriftSqlType.double);
|
||||||
type: i1.DriftSqlType.double);
|
|
||||||
i1.GeneratedColumn<double> _column_47(String aliasedName) =>
|
i1.GeneratedColumn<double> _column_47(String aliasedName) =>
|
||||||
i1.GeneratedColumn<double>('longitude', aliasedName, true,
|
i1.GeneratedColumn<double>('longitude', aliasedName, true, type: i1.DriftSqlType.double);
|
||||||
type: i1.DriftSqlType.double);
|
|
||||||
i1.GeneratedColumn<int> _column_48(String aliasedName) =>
|
i1.GeneratedColumn<int> _column_48(String aliasedName) =>
|
||||||
i1.GeneratedColumn<int>('iso', aliasedName, true,
|
i1.GeneratedColumn<int>('iso', aliasedName, true, type: i1.DriftSqlType.int);
|
||||||
type: i1.DriftSqlType.int);
|
|
||||||
i1.GeneratedColumn<String> _column_49(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_49(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('make', aliasedName, true,
|
i1.GeneratedColumn<String>('make', aliasedName, true, type: i1.DriftSqlType.string);
|
||||||
type: i1.DriftSqlType.string);
|
|
||||||
i1.GeneratedColumn<String> _column_50(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_50(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('model', aliasedName, true,
|
i1.GeneratedColumn<String>('model', aliasedName, true, type: i1.DriftSqlType.string);
|
||||||
type: i1.DriftSqlType.string);
|
|
||||||
i1.GeneratedColumn<String> _column_51(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_51(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('lens', aliasedName, true,
|
i1.GeneratedColumn<String>('lens', aliasedName, true, type: i1.DriftSqlType.string);
|
||||||
type: i1.DriftSqlType.string);
|
|
||||||
i1.GeneratedColumn<String> _column_52(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_52(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('orientation', aliasedName, true,
|
i1.GeneratedColumn<String>('orientation', aliasedName, true, type: i1.DriftSqlType.string);
|
||||||
type: i1.DriftSqlType.string);
|
|
||||||
i1.GeneratedColumn<String> _column_53(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_53(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('time_zone', aliasedName, true,
|
i1.GeneratedColumn<String>('time_zone', aliasedName, true, type: i1.DriftSqlType.string);
|
||||||
type: i1.DriftSqlType.string);
|
|
||||||
i1.GeneratedColumn<int> _column_54(String aliasedName) =>
|
i1.GeneratedColumn<int> _column_54(String aliasedName) =>
|
||||||
i1.GeneratedColumn<int>('rating', aliasedName, true,
|
i1.GeneratedColumn<int>('rating', aliasedName, true, type: i1.DriftSqlType.int);
|
||||||
type: i1.DriftSqlType.int);
|
|
||||||
i1.GeneratedColumn<String> _column_55(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_55(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('projection_type', aliasedName, true,
|
i1.GeneratedColumn<String>('projection_type', aliasedName, true, type: i1.DriftSqlType.string);
|
||||||
type: i1.DriftSqlType.string);
|
|
||||||
|
|
||||||
class Shape9 extends i0.VersionedTable {
|
class Shape9 extends i0.VersionedTable {
|
||||||
Shape9({required super.source, required super.alias}) : super.aliased();
|
Shape9({required super.source, required super.alias}) : super.aliased();
|
||||||
i1.GeneratedColumn<String> get id =>
|
i1.GeneratedColumn<String> get id => columnsByName['id']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['id']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<String> get name => columnsByName['name']! as i1.GeneratedColumn<String>;
|
||||||
i1.GeneratedColumn<String> get name =>
|
i1.GeneratedColumn<String> get description => columnsByName['description']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['name']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<DateTime> get createdAt => columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
|
||||||
i1.GeneratedColumn<String> get description =>
|
i1.GeneratedColumn<DateTime> get updatedAt => columnsByName['updated_at']! as i1.GeneratedColumn<DateTime>;
|
||||||
columnsByName['description']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<String> get ownerId => columnsByName['owner_id']! as i1.GeneratedColumn<String>;
|
||||||
i1.GeneratedColumn<DateTime> get createdAt =>
|
i1.GeneratedColumn<String> get thumbnailAssetId => columnsByName['thumbnail_asset_id']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
|
i1.GeneratedColumn<bool> get isActivityEnabled => columnsByName['is_activity_enabled']! as i1.GeneratedColumn<bool>;
|
||||||
i1.GeneratedColumn<DateTime> get updatedAt =>
|
i1.GeneratedColumn<int> get order => columnsByName['order']! as i1.GeneratedColumn<int>;
|
||||||
columnsByName['updated_at']! as i1.GeneratedColumn<DateTime>;
|
|
||||||
i1.GeneratedColumn<String> get ownerId =>
|
|
||||||
columnsByName['owner_id']! as i1.GeneratedColumn<String>;
|
|
||||||
i1.GeneratedColumn<String> get thumbnailAssetId =>
|
|
||||||
columnsByName['thumbnail_asset_id']! as i1.GeneratedColumn<String>;
|
|
||||||
i1.GeneratedColumn<bool> get isActivityEnabled =>
|
|
||||||
columnsByName['is_activity_enabled']! as i1.GeneratedColumn<bool>;
|
|
||||||
i1.GeneratedColumn<int> get order =>
|
|
||||||
columnsByName['order']! as i1.GeneratedColumn<int>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.GeneratedColumn<String> _column_56(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_56(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('description', aliasedName, false,
|
i1.GeneratedColumn<String>('description', aliasedName, false,
|
||||||
type: i1.DriftSqlType.string,
|
type: i1.DriftSqlType.string, defaultValue: const CustomExpression('\'\''));
|
||||||
defaultValue: const CustomExpression('\'\''));
|
|
||||||
i1.GeneratedColumn<String> _column_57(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_57(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('thumbnail_asset_id', aliasedName, true,
|
i1.GeneratedColumn<String>('thumbnail_asset_id', aliasedName, true,
|
||||||
type: i1.DriftSqlType.string,
|
type: i1.DriftSqlType.string,
|
||||||
defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
|
defaultConstraints:
|
||||||
'REFERENCES remote_asset_entity (id) ON DELETE SET NULL'));
|
i1.GeneratedColumn.constraintIsAlways('REFERENCES remote_asset_entity (id) ON DELETE SET NULL'));
|
||||||
i1.GeneratedColumn<bool> _column_58(String aliasedName) =>
|
i1.GeneratedColumn<bool> _column_58(String aliasedName) =>
|
||||||
i1.GeneratedColumn<bool>('is_activity_enabled', aliasedName, false,
|
i1.GeneratedColumn<bool>('is_activity_enabled', aliasedName, false,
|
||||||
type: i1.DriftSqlType.bool,
|
type: i1.DriftSqlType.bool,
|
||||||
defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
|
defaultConstraints: i1.GeneratedColumn.constraintIsAlways('CHECK ("is_activity_enabled" IN (0, 1))'),
|
||||||
'CHECK ("is_activity_enabled" IN (0, 1))'),
|
|
||||||
defaultValue: const CustomExpression('1'));
|
defaultValue: const CustomExpression('1'));
|
||||||
i1.GeneratedColumn<int> _column_59(String aliasedName) =>
|
i1.GeneratedColumn<int> _column_59(String aliasedName) =>
|
||||||
i1.GeneratedColumn<int>('order', aliasedName, false,
|
i1.GeneratedColumn<int>('order', aliasedName, false, type: i1.DriftSqlType.int);
|
||||||
type: i1.DriftSqlType.int);
|
i1.GeneratedColumn<String> _column_60(String aliasedName) => i1.GeneratedColumn<String>('album_id', aliasedName, false,
|
||||||
i1.GeneratedColumn<String> _column_60(String aliasedName) =>
|
|
||||||
i1.GeneratedColumn<String>('album_id', aliasedName, false,
|
|
||||||
type: i1.DriftSqlType.string,
|
type: i1.DriftSqlType.string,
|
||||||
defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
|
defaultConstraints: i1.GeneratedColumn.constraintIsAlways('REFERENCES remote_album_entity (id) ON DELETE CASCADE'));
|
||||||
'REFERENCES remote_album_entity (id) ON DELETE CASCADE'));
|
|
||||||
|
|
||||||
class Shape10 extends i0.VersionedTable {
|
class Shape10 extends i0.VersionedTable {
|
||||||
Shape10({required super.source, required super.alias}) : super.aliased();
|
Shape10({required super.source, required super.alias}) : super.aliased();
|
||||||
i1.GeneratedColumn<String> get albumId =>
|
i1.GeneratedColumn<String> get albumId => columnsByName['album_id']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['album_id']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<String> get userId => columnsByName['user_id']! as i1.GeneratedColumn<String>;
|
||||||
i1.GeneratedColumn<String> get userId =>
|
i1.GeneratedColumn<int> get role => columnsByName['role']! as i1.GeneratedColumn<int>;
|
||||||
columnsByName['user_id']! as i1.GeneratedColumn<String>;
|
|
||||||
i1.GeneratedColumn<int> get role =>
|
|
||||||
columnsByName['role']! as i1.GeneratedColumn<int>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.GeneratedColumn<int> _column_61(String aliasedName) =>
|
i1.GeneratedColumn<int> _column_61(String aliasedName) =>
|
||||||
i1.GeneratedColumn<int>('role', aliasedName, false,
|
i1.GeneratedColumn<int>('role', aliasedName, false, type: i1.DriftSqlType.int);
|
||||||
type: i1.DriftSqlType.int);
|
|
||||||
|
|
||||||
class Shape11 extends i0.VersionedTable {
|
class Shape11 extends i0.VersionedTable {
|
||||||
Shape11({required super.source, required super.alias}) : super.aliased();
|
Shape11({required super.source, required super.alias}) : super.aliased();
|
||||||
i1.GeneratedColumn<String> get id =>
|
i1.GeneratedColumn<String> get id => columnsByName['id']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['id']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<DateTime> get createdAt => columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
|
||||||
i1.GeneratedColumn<DateTime> get createdAt =>
|
i1.GeneratedColumn<DateTime> get updatedAt => columnsByName['updated_at']! as i1.GeneratedColumn<DateTime>;
|
||||||
columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
|
i1.GeneratedColumn<DateTime> get deletedAt => columnsByName['deleted_at']! as i1.GeneratedColumn<DateTime>;
|
||||||
i1.GeneratedColumn<DateTime> get updatedAt =>
|
i1.GeneratedColumn<String> get ownerId => columnsByName['owner_id']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['updated_at']! as i1.GeneratedColumn<DateTime>;
|
i1.GeneratedColumn<int> get type => columnsByName['type']! as i1.GeneratedColumn<int>;
|
||||||
i1.GeneratedColumn<DateTime> get deletedAt =>
|
i1.GeneratedColumn<String> get data => columnsByName['data']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['deleted_at']! as i1.GeneratedColumn<DateTime>;
|
i1.GeneratedColumn<bool> get isSaved => columnsByName['is_saved']! as i1.GeneratedColumn<bool>;
|
||||||
i1.GeneratedColumn<String> get ownerId =>
|
i1.GeneratedColumn<DateTime> get memoryAt => columnsByName['memory_at']! as i1.GeneratedColumn<DateTime>;
|
||||||
columnsByName['owner_id']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<DateTime> get seenAt => columnsByName['seen_at']! as i1.GeneratedColumn<DateTime>;
|
||||||
i1.GeneratedColumn<int> get type =>
|
i1.GeneratedColumn<DateTime> get showAt => columnsByName['show_at']! as i1.GeneratedColumn<DateTime>;
|
||||||
columnsByName['type']! as i1.GeneratedColumn<int>;
|
i1.GeneratedColumn<DateTime> get hideAt => columnsByName['hide_at']! as i1.GeneratedColumn<DateTime>;
|
||||||
i1.GeneratedColumn<String> get data =>
|
|
||||||
columnsByName['data']! as i1.GeneratedColumn<String>;
|
|
||||||
i1.GeneratedColumn<bool> get isSaved =>
|
|
||||||
columnsByName['is_saved']! as i1.GeneratedColumn<bool>;
|
|
||||||
i1.GeneratedColumn<DateTime> get memoryAt =>
|
|
||||||
columnsByName['memory_at']! as i1.GeneratedColumn<DateTime>;
|
|
||||||
i1.GeneratedColumn<DateTime> get seenAt =>
|
|
||||||
columnsByName['seen_at']! as i1.GeneratedColumn<DateTime>;
|
|
||||||
i1.GeneratedColumn<DateTime> get showAt =>
|
|
||||||
columnsByName['show_at']! as i1.GeneratedColumn<DateTime>;
|
|
||||||
i1.GeneratedColumn<DateTime> get hideAt =>
|
|
||||||
columnsByName['hide_at']! as i1.GeneratedColumn<DateTime>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.GeneratedColumn<String> _column_62(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_62(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('data', aliasedName, false,
|
i1.GeneratedColumn<String>('data', aliasedName, false, type: i1.DriftSqlType.string);
|
||||||
type: i1.DriftSqlType.string);
|
i1.GeneratedColumn<bool> _column_63(String aliasedName) => i1.GeneratedColumn<bool>('is_saved', aliasedName, false,
|
||||||
i1.GeneratedColumn<bool> _column_63(String aliasedName) =>
|
|
||||||
i1.GeneratedColumn<bool>('is_saved', aliasedName, false,
|
|
||||||
type: i1.DriftSqlType.bool,
|
type: i1.DriftSqlType.bool,
|
||||||
defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
|
defaultConstraints: i1.GeneratedColumn.constraintIsAlways('CHECK ("is_saved" IN (0, 1))'),
|
||||||
'CHECK ("is_saved" IN (0, 1))'),
|
|
||||||
defaultValue: const CustomExpression('0'));
|
defaultValue: const CustomExpression('0'));
|
||||||
i1.GeneratedColumn<DateTime> _column_64(String aliasedName) =>
|
i1.GeneratedColumn<DateTime> _column_64(String aliasedName) =>
|
||||||
i1.GeneratedColumn<DateTime>('memory_at', aliasedName, false,
|
i1.GeneratedColumn<DateTime>('memory_at', aliasedName, false, type: i1.DriftSqlType.dateTime);
|
||||||
type: i1.DriftSqlType.dateTime);
|
|
||||||
i1.GeneratedColumn<DateTime> _column_65(String aliasedName) =>
|
i1.GeneratedColumn<DateTime> _column_65(String aliasedName) =>
|
||||||
i1.GeneratedColumn<DateTime>('seen_at', aliasedName, true,
|
i1.GeneratedColumn<DateTime>('seen_at', aliasedName, true, type: i1.DriftSqlType.dateTime);
|
||||||
type: i1.DriftSqlType.dateTime);
|
|
||||||
i1.GeneratedColumn<DateTime> _column_66(String aliasedName) =>
|
i1.GeneratedColumn<DateTime> _column_66(String aliasedName) =>
|
||||||
i1.GeneratedColumn<DateTime>('show_at', aliasedName, true,
|
i1.GeneratedColumn<DateTime>('show_at', aliasedName, true, type: i1.DriftSqlType.dateTime);
|
||||||
type: i1.DriftSqlType.dateTime);
|
|
||||||
i1.GeneratedColumn<DateTime> _column_67(String aliasedName) =>
|
i1.GeneratedColumn<DateTime> _column_67(String aliasedName) =>
|
||||||
i1.GeneratedColumn<DateTime>('hide_at', aliasedName, true,
|
i1.GeneratedColumn<DateTime>('hide_at', aliasedName, true, type: i1.DriftSqlType.dateTime);
|
||||||
type: i1.DriftSqlType.dateTime);
|
|
||||||
|
|
||||||
class Shape12 extends i0.VersionedTable {
|
class Shape12 extends i0.VersionedTable {
|
||||||
Shape12({required super.source, required super.alias}) : super.aliased();
|
Shape12({required super.source, required super.alias}) : super.aliased();
|
||||||
i1.GeneratedColumn<String> get assetId =>
|
i1.GeneratedColumn<String> get assetId => columnsByName['asset_id']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['asset_id']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<String> get memoryId => columnsByName['memory_id']! as i1.GeneratedColumn<String>;
|
||||||
i1.GeneratedColumn<String> get memoryId =>
|
|
||||||
columnsByName['memory_id']! as i1.GeneratedColumn<String>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.GeneratedColumn<String> _column_68(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_68(String aliasedName) => i1.GeneratedColumn<String>('memory_id', aliasedName, false,
|
||||||
i1.GeneratedColumn<String>('memory_id', aliasedName, false,
|
|
||||||
type: i1.DriftSqlType.string,
|
type: i1.DriftSqlType.string,
|
||||||
defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
|
defaultConstraints: i1.GeneratedColumn.constraintIsAlways('REFERENCES memory_entity (id) ON DELETE CASCADE'));
|
||||||
'REFERENCES memory_entity (id) ON DELETE CASCADE'));
|
|
||||||
|
|
||||||
class Shape13 extends i0.VersionedTable {
|
class Shape13 extends i0.VersionedTable {
|
||||||
Shape13({required super.source, required super.alias}) : super.aliased();
|
Shape13({required super.source, required super.alias}) : super.aliased();
|
||||||
i1.GeneratedColumn<String> get id =>
|
i1.GeneratedColumn<String> get id => columnsByName['id']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['id']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<DateTime> get createdAt => columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
|
||||||
i1.GeneratedColumn<DateTime> get createdAt =>
|
i1.GeneratedColumn<DateTime> get updatedAt => columnsByName['updated_at']! as i1.GeneratedColumn<DateTime>;
|
||||||
columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
|
i1.GeneratedColumn<String> get ownerId => columnsByName['owner_id']! as i1.GeneratedColumn<String>;
|
||||||
i1.GeneratedColumn<DateTime> get updatedAt =>
|
i1.GeneratedColumn<String> get name => columnsByName['name']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['updated_at']! as i1.GeneratedColumn<DateTime>;
|
i1.GeneratedColumn<String> get faceAssetId => columnsByName['face_asset_id']! as i1.GeneratedColumn<String>;
|
||||||
i1.GeneratedColumn<String> get ownerId =>
|
i1.GeneratedColumn<String> get thumbnailPath => columnsByName['thumbnail_path']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['owner_id']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<bool> get isFavorite => columnsByName['is_favorite']! as i1.GeneratedColumn<bool>;
|
||||||
i1.GeneratedColumn<String> get name =>
|
i1.GeneratedColumn<bool> get isHidden => columnsByName['is_hidden']! as i1.GeneratedColumn<bool>;
|
||||||
columnsByName['name']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<String> get color => columnsByName['color']! as i1.GeneratedColumn<String>;
|
||||||
i1.GeneratedColumn<String> get faceAssetId =>
|
i1.GeneratedColumn<DateTime> get birthDate => columnsByName['birth_date']! as i1.GeneratedColumn<DateTime>;
|
||||||
columnsByName['face_asset_id']! as i1.GeneratedColumn<String>;
|
|
||||||
i1.GeneratedColumn<String> get thumbnailPath =>
|
|
||||||
columnsByName['thumbnail_path']! as i1.GeneratedColumn<String>;
|
|
||||||
i1.GeneratedColumn<bool> get isFavorite =>
|
|
||||||
columnsByName['is_favorite']! as i1.GeneratedColumn<bool>;
|
|
||||||
i1.GeneratedColumn<bool> get isHidden =>
|
|
||||||
columnsByName['is_hidden']! as i1.GeneratedColumn<bool>;
|
|
||||||
i1.GeneratedColumn<String> get color =>
|
|
||||||
columnsByName['color']! as i1.GeneratedColumn<String>;
|
|
||||||
i1.GeneratedColumn<DateTime> get birthDate =>
|
|
||||||
columnsByName['birth_date']! as i1.GeneratedColumn<DateTime>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.GeneratedColumn<String> _column_69(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_69(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('face_asset_id', aliasedName, true,
|
i1.GeneratedColumn<String>('face_asset_id', aliasedName, true, type: i1.DriftSqlType.string);
|
||||||
type: i1.DriftSqlType.string);
|
|
||||||
i1.GeneratedColumn<String> _column_70(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_70(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('thumbnail_path', aliasedName, false,
|
i1.GeneratedColumn<String>('thumbnail_path', aliasedName, false, type: i1.DriftSqlType.string);
|
||||||
type: i1.DriftSqlType.string);
|
i1.GeneratedColumn<bool> _column_71(String aliasedName) => i1.GeneratedColumn<bool>('is_favorite', aliasedName, false,
|
||||||
i1.GeneratedColumn<bool> _column_71(String aliasedName) =>
|
|
||||||
i1.GeneratedColumn<bool>('is_favorite', aliasedName, false,
|
|
||||||
type: i1.DriftSqlType.bool,
|
type: i1.DriftSqlType.bool,
|
||||||
defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
|
defaultConstraints: i1.GeneratedColumn.constraintIsAlways('CHECK ("is_favorite" IN (0, 1))'));
|
||||||
'CHECK ("is_favorite" IN (0, 1))'));
|
i1.GeneratedColumn<bool> _column_72(String aliasedName) => i1.GeneratedColumn<bool>('is_hidden', aliasedName, false,
|
||||||
i1.GeneratedColumn<bool> _column_72(String aliasedName) =>
|
|
||||||
i1.GeneratedColumn<bool>('is_hidden', aliasedName, false,
|
|
||||||
type: i1.DriftSqlType.bool,
|
type: i1.DriftSqlType.bool,
|
||||||
defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
|
defaultConstraints: i1.GeneratedColumn.constraintIsAlways('CHECK ("is_hidden" IN (0, 1))'));
|
||||||
'CHECK ("is_hidden" IN (0, 1))'));
|
|
||||||
i1.GeneratedColumn<String> _column_73(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_73(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('color', aliasedName, true,
|
i1.GeneratedColumn<String>('color', aliasedName, true, type: i1.DriftSqlType.string);
|
||||||
type: i1.DriftSqlType.string);
|
|
||||||
i1.GeneratedColumn<DateTime> _column_74(String aliasedName) =>
|
i1.GeneratedColumn<DateTime> _column_74(String aliasedName) =>
|
||||||
i1.GeneratedColumn<DateTime>('birth_date', aliasedName, true,
|
i1.GeneratedColumn<DateTime>('birth_date', aliasedName, true, type: i1.DriftSqlType.dateTime);
|
||||||
type: i1.DriftSqlType.dateTime);
|
|
||||||
|
|
||||||
final class Schema3 extends i0.VersionedSchema {
|
final class Schema3 extends i0.VersionedSchema {
|
||||||
Schema3({required super.database}) : super(version: 3);
|
Schema3({required super.database}) : super(version: 3);
|
||||||
@ -1036,13 +836,12 @@ final class Schema3 extends i0.VersionedSchema {
|
|||||||
attachedDatabase: database,
|
attachedDatabase: database,
|
||||||
),
|
),
|
||||||
alias: null);
|
alias: null);
|
||||||
final i1.Index idxLocalAssetChecksum = i1.Index('idx_local_asset_checksum',
|
final i1.Index idxLocalAssetChecksum =
|
||||||
'CREATE INDEX idx_local_asset_checksum ON local_asset_entity (checksum)');
|
i1.Index('idx_local_asset_checksum', 'CREATE INDEX idx_local_asset_checksum ON local_asset_entity (checksum)');
|
||||||
final i1.Index uQRemoteAssetOwnerChecksum = i1.Index(
|
final i1.Index uQRemoteAssetOwnerChecksum = i1.Index('UQ_remote_asset_owner_checksum',
|
||||||
'UQ_remote_asset_owner_checksum',
|
|
||||||
'CREATE UNIQUE INDEX UQ_remote_asset_owner_checksum ON remote_asset_entity (checksum, owner_id)');
|
'CREATE UNIQUE INDEX UQ_remote_asset_owner_checksum ON remote_asset_entity (checksum, owner_id)');
|
||||||
final i1.Index idxRemoteAssetChecksum = i1.Index('idx_remote_asset_checksum',
|
final i1.Index idxRemoteAssetChecksum =
|
||||||
'CREATE INDEX idx_remote_asset_checksum ON remote_asset_entity (checksum)');
|
i1.Index('idx_remote_asset_checksum', 'CREATE INDEX idx_remote_asset_checksum ON remote_asset_entity (checksum)');
|
||||||
late final Shape4 userMetadataEntity = Shape4(
|
late final Shape4 userMetadataEntity = Shape4(
|
||||||
source: i0.VersionedTable(
|
source: i0.VersionedTable(
|
||||||
entityName: 'user_metadata_entity',
|
entityName: 'user_metadata_entity',
|
||||||
@ -1264,8 +1063,7 @@ final class Schema3 extends i0.VersionedSchema {
|
|||||||
}
|
}
|
||||||
|
|
||||||
i1.GeneratedColumn<String> _column_75(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_75(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('primary_asset_id', aliasedName, false,
|
i1.GeneratedColumn<String>('primary_asset_id', aliasedName, false, type: i1.DriftSqlType.string);
|
||||||
type: i1.DriftSqlType.string);
|
|
||||||
|
|
||||||
final class Schema4 extends i0.VersionedSchema {
|
final class Schema4 extends i0.VersionedSchema {
|
||||||
Schema4({required super.database}) : super(version: 4);
|
Schema4({required super.database}) : super(version: 4);
|
||||||
@ -1418,13 +1216,12 @@ final class Schema4 extends i0.VersionedSchema {
|
|||||||
attachedDatabase: database,
|
attachedDatabase: database,
|
||||||
),
|
),
|
||||||
alias: null);
|
alias: null);
|
||||||
final i1.Index idxLocalAssetChecksum = i1.Index('idx_local_asset_checksum',
|
final i1.Index idxLocalAssetChecksum =
|
||||||
'CREATE INDEX idx_local_asset_checksum ON local_asset_entity (checksum)');
|
i1.Index('idx_local_asset_checksum', 'CREATE INDEX idx_local_asset_checksum ON local_asset_entity (checksum)');
|
||||||
final i1.Index uQRemoteAssetOwnerChecksum = i1.Index(
|
final i1.Index uQRemoteAssetOwnerChecksum = i1.Index('UQ_remote_asset_owner_checksum',
|
||||||
'UQ_remote_asset_owner_checksum',
|
|
||||||
'CREATE UNIQUE INDEX UQ_remote_asset_owner_checksum ON remote_asset_entity (checksum, owner_id)');
|
'CREATE UNIQUE INDEX UQ_remote_asset_owner_checksum ON remote_asset_entity (checksum, owner_id)');
|
||||||
final i1.Index idxRemoteAssetChecksum = i1.Index('idx_remote_asset_checksum',
|
final i1.Index idxRemoteAssetChecksum =
|
||||||
'CREATE INDEX idx_remote_asset_checksum ON remote_asset_entity (checksum)');
|
i1.Index('idx_remote_asset_checksum', 'CREATE INDEX idx_remote_asset_checksum ON remote_asset_entity (checksum)');
|
||||||
late final Shape4 userMetadataEntity = Shape4(
|
late final Shape4 userMetadataEntity = Shape4(
|
||||||
source: i0.VersionedTable(
|
source: i0.VersionedTable(
|
||||||
entityName: 'user_metadata_entity',
|
entityName: 'user_metadata_entity',
|
||||||
@ -1635,78 +1432,49 @@ final class Schema4 extends i0.VersionedSchema {
|
|||||||
|
|
||||||
class Shape14 extends i0.VersionedTable {
|
class Shape14 extends i0.VersionedTable {
|
||||||
Shape14({required super.source, required super.alias}) : super.aliased();
|
Shape14({required super.source, required super.alias}) : super.aliased();
|
||||||
i1.GeneratedColumn<String> get id =>
|
i1.GeneratedColumn<String> get id => columnsByName['id']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['id']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<DateTime> get createdAt => columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
|
||||||
i1.GeneratedColumn<DateTime> get createdAt =>
|
i1.GeneratedColumn<DateTime> get updatedAt => columnsByName['updated_at']! as i1.GeneratedColumn<DateTime>;
|
||||||
columnsByName['created_at']! as i1.GeneratedColumn<DateTime>;
|
i1.GeneratedColumn<String> get ownerId => columnsByName['owner_id']! as i1.GeneratedColumn<String>;
|
||||||
i1.GeneratedColumn<DateTime> get updatedAt =>
|
i1.GeneratedColumn<String> get name => columnsByName['name']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['updated_at']! as i1.GeneratedColumn<DateTime>;
|
i1.GeneratedColumn<String> get faceAssetId => columnsByName['face_asset_id']! as i1.GeneratedColumn<String>;
|
||||||
i1.GeneratedColumn<String> get ownerId =>
|
i1.GeneratedColumn<bool> get isFavorite => columnsByName['is_favorite']! as i1.GeneratedColumn<bool>;
|
||||||
columnsByName['owner_id']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<bool> get isHidden => columnsByName['is_hidden']! as i1.GeneratedColumn<bool>;
|
||||||
i1.GeneratedColumn<String> get name =>
|
i1.GeneratedColumn<String> get color => columnsByName['color']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['name']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<DateTime> get birthDate => columnsByName['birth_date']! as i1.GeneratedColumn<DateTime>;
|
||||||
i1.GeneratedColumn<String> get faceAssetId =>
|
|
||||||
columnsByName['face_asset_id']! as i1.GeneratedColumn<String>;
|
|
||||||
i1.GeneratedColumn<bool> get isFavorite =>
|
|
||||||
columnsByName['is_favorite']! as i1.GeneratedColumn<bool>;
|
|
||||||
i1.GeneratedColumn<bool> get isHidden =>
|
|
||||||
columnsByName['is_hidden']! as i1.GeneratedColumn<bool>;
|
|
||||||
i1.GeneratedColumn<String> get color =>
|
|
||||||
columnsByName['color']! as i1.GeneratedColumn<String>;
|
|
||||||
i1.GeneratedColumn<DateTime> get birthDate =>
|
|
||||||
columnsByName['birth_date']! as i1.GeneratedColumn<DateTime>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class Shape15 extends i0.VersionedTable {
|
class Shape15 extends i0.VersionedTable {
|
||||||
Shape15({required super.source, required super.alias}) : super.aliased();
|
Shape15({required super.source, required super.alias}) : super.aliased();
|
||||||
i1.GeneratedColumn<String> get id =>
|
i1.GeneratedColumn<String> get id => columnsByName['id']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['id']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<String> get assetId => columnsByName['asset_id']! as i1.GeneratedColumn<String>;
|
||||||
i1.GeneratedColumn<String> get assetId =>
|
i1.GeneratedColumn<String> get personId => columnsByName['person_id']! as i1.GeneratedColumn<String>;
|
||||||
columnsByName['asset_id']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<int> get imageWidth => columnsByName['image_width']! as i1.GeneratedColumn<int>;
|
||||||
i1.GeneratedColumn<String> get personId =>
|
i1.GeneratedColumn<int> get imageHeight => columnsByName['image_height']! as i1.GeneratedColumn<int>;
|
||||||
columnsByName['person_id']! as i1.GeneratedColumn<String>;
|
i1.GeneratedColumn<int> get boundingBoxX1 => columnsByName['bounding_box_x1']! as i1.GeneratedColumn<int>;
|
||||||
i1.GeneratedColumn<int> get imageWidth =>
|
i1.GeneratedColumn<int> get boundingBoxY1 => columnsByName['bounding_box_y1']! as i1.GeneratedColumn<int>;
|
||||||
columnsByName['image_width']! as i1.GeneratedColumn<int>;
|
i1.GeneratedColumn<int> get boundingBoxX2 => columnsByName['bounding_box_x2']! as i1.GeneratedColumn<int>;
|
||||||
i1.GeneratedColumn<int> get imageHeight =>
|
i1.GeneratedColumn<int> get boundingBoxY2 => columnsByName['bounding_box_y2']! as i1.GeneratedColumn<int>;
|
||||||
columnsByName['image_height']! as i1.GeneratedColumn<int>;
|
i1.GeneratedColumn<String> get sourceType => columnsByName['source_type']! as i1.GeneratedColumn<String>;
|
||||||
i1.GeneratedColumn<int> get boundingBoxX1 =>
|
|
||||||
columnsByName['bounding_box_x1']! as i1.GeneratedColumn<int>;
|
|
||||||
i1.GeneratedColumn<int> get boundingBoxY1 =>
|
|
||||||
columnsByName['bounding_box_y1']! as i1.GeneratedColumn<int>;
|
|
||||||
i1.GeneratedColumn<int> get boundingBoxX2 =>
|
|
||||||
columnsByName['bounding_box_x2']! as i1.GeneratedColumn<int>;
|
|
||||||
i1.GeneratedColumn<int> get boundingBoxY2 =>
|
|
||||||
columnsByName['bounding_box_y2']! as i1.GeneratedColumn<int>;
|
|
||||||
i1.GeneratedColumn<String> get sourceType =>
|
|
||||||
columnsByName['source_type']! as i1.GeneratedColumn<String>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
i1.GeneratedColumn<String> _column_76(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_76(String aliasedName) => i1.GeneratedColumn<String>('person_id', aliasedName, true,
|
||||||
i1.GeneratedColumn<String>('person_id', aliasedName, true,
|
|
||||||
type: i1.DriftSqlType.string,
|
type: i1.DriftSqlType.string,
|
||||||
defaultConstraints: i1.GeneratedColumn.constraintIsAlways(
|
defaultConstraints: i1.GeneratedColumn.constraintIsAlways('REFERENCES person_entity (id) ON DELETE SET NULL'));
|
||||||
'REFERENCES person_entity (id) ON DELETE SET NULL'));
|
|
||||||
i1.GeneratedColumn<int> _column_77(String aliasedName) =>
|
i1.GeneratedColumn<int> _column_77(String aliasedName) =>
|
||||||
i1.GeneratedColumn<int>('image_width', aliasedName, false,
|
i1.GeneratedColumn<int>('image_width', aliasedName, false, type: i1.DriftSqlType.int);
|
||||||
type: i1.DriftSqlType.int);
|
|
||||||
i1.GeneratedColumn<int> _column_78(String aliasedName) =>
|
i1.GeneratedColumn<int> _column_78(String aliasedName) =>
|
||||||
i1.GeneratedColumn<int>('image_height', aliasedName, false,
|
i1.GeneratedColumn<int>('image_height', aliasedName, false, type: i1.DriftSqlType.int);
|
||||||
type: i1.DriftSqlType.int);
|
|
||||||
i1.GeneratedColumn<int> _column_79(String aliasedName) =>
|
i1.GeneratedColumn<int> _column_79(String aliasedName) =>
|
||||||
i1.GeneratedColumn<int>('bounding_box_x1', aliasedName, false,
|
i1.GeneratedColumn<int>('bounding_box_x1', aliasedName, false, type: i1.DriftSqlType.int);
|
||||||
type: i1.DriftSqlType.int);
|
|
||||||
i1.GeneratedColumn<int> _column_80(String aliasedName) =>
|
i1.GeneratedColumn<int> _column_80(String aliasedName) =>
|
||||||
i1.GeneratedColumn<int>('bounding_box_y1', aliasedName, false,
|
i1.GeneratedColumn<int>('bounding_box_y1', aliasedName, false, type: i1.DriftSqlType.int);
|
||||||
type: i1.DriftSqlType.int);
|
|
||||||
i1.GeneratedColumn<int> _column_81(String aliasedName) =>
|
i1.GeneratedColumn<int> _column_81(String aliasedName) =>
|
||||||
i1.GeneratedColumn<int>('bounding_box_x2', aliasedName, false,
|
i1.GeneratedColumn<int>('bounding_box_x2', aliasedName, false, type: i1.DriftSqlType.int);
|
||||||
type: i1.DriftSqlType.int);
|
|
||||||
i1.GeneratedColumn<int> _column_82(String aliasedName) =>
|
i1.GeneratedColumn<int> _column_82(String aliasedName) =>
|
||||||
i1.GeneratedColumn<int>('bounding_box_y2', aliasedName, false,
|
i1.GeneratedColumn<int>('bounding_box_y2', aliasedName, false, type: i1.DriftSqlType.int);
|
||||||
type: i1.DriftSqlType.int);
|
|
||||||
i1.GeneratedColumn<String> _column_83(String aliasedName) =>
|
i1.GeneratedColumn<String> _column_83(String aliasedName) =>
|
||||||
i1.GeneratedColumn<String>('source_type', aliasedName, false,
|
i1.GeneratedColumn<String>('source_type', aliasedName, false, type: i1.DriftSqlType.string);
|
||||||
type: i1.DriftSqlType.string);
|
|
||||||
i0.MigrationStepWithVersion migrationSteps({
|
i0.MigrationStepWithVersion migrationSteps({
|
||||||
required Future<void> Function(i1.Migrator m, Schema2 schema) from1To2,
|
required Future<void> Function(i1.Migrator m, Schema2 schema) from1To2,
|
||||||
required Future<void> Function(i1.Migrator m, Schema3 schema) from2To3,
|
required Future<void> Function(i1.Migrator m, Schema3 schema) from2To3,
|
||||||
|
@ -24,8 +24,7 @@ class IsarDeviceAssetRepository extends IsarDatabaseRepository {
|
|||||||
|
|
||||||
Future<bool> updateAll(List<DeviceAsset> assetHash) {
|
Future<bool> updateAll(List<DeviceAsset> assetHash) {
|
||||||
return transaction(() async {
|
return transaction(() async {
|
||||||
await _db.deviceAssetEntitys
|
await _db.deviceAssetEntitys.putAll(assetHash.map(DeviceAssetEntity.fromDto).toList());
|
||||||
.putAll(assetHash.map(DeviceAssetEntity.fromDto).toList());
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import 'package:immich_mobile/domain/models/exif.model.dart';
|
import 'package:immich_mobile/domain/models/exif.model.dart';
|
||||||
import 'package:immich_mobile/infrastructure/entities/exif.entity.dart'
|
import 'package:immich_mobile/infrastructure/entities/exif.entity.dart' as entity;
|
||||||
as entity;
|
|
||||||
import 'package:immich_mobile/infrastructure/repositories/db.repository.dart';
|
import 'package:immich_mobile/infrastructure/repositories/db.repository.dart';
|
||||||
import 'package:isar/isar.dart';
|
import 'package:isar/isar.dart';
|
||||||
|
|
||||||
|
@ -8,13 +8,7 @@ import 'package:immich_mobile/infrastructure/repositories/db.repository.dart';
|
|||||||
import 'package:immich_mobile/utils/database.utils.dart';
|
import 'package:immich_mobile/utils/database.utils.dart';
|
||||||
import 'package:platform/platform.dart';
|
import 'package:platform/platform.dart';
|
||||||
|
|
||||||
enum SortLocalAlbumsBy {
|
enum SortLocalAlbumsBy { id, backupSelection, isIosSharedAlbum, name, assetCount }
|
||||||
id,
|
|
||||||
backupSelection,
|
|
||||||
isIosSharedAlbum,
|
|
||||||
name,
|
|
||||||
assetCount
|
|
||||||
}
|
|
||||||
|
|
||||||
class DriftLocalAlbumRepository extends DriftDatabaseRepository {
|
class DriftLocalAlbumRepository extends DriftDatabaseRepository {
|
||||||
final Drift _db;
|
final Drift _db;
|
||||||
@ -43,12 +37,9 @@ class DriftLocalAlbumRepository extends DriftDatabaseRepository {
|
|||||||
orderings.add(
|
orderings.add(
|
||||||
switch (sort) {
|
switch (sort) {
|
||||||
SortLocalAlbumsBy.id => OrderingTerm.asc(_db.localAlbumEntity.id),
|
SortLocalAlbumsBy.id => OrderingTerm.asc(_db.localAlbumEntity.id),
|
||||||
SortLocalAlbumsBy.backupSelection =>
|
SortLocalAlbumsBy.backupSelection => OrderingTerm.asc(_db.localAlbumEntity.backupSelection),
|
||||||
OrderingTerm.asc(_db.localAlbumEntity.backupSelection),
|
SortLocalAlbumsBy.isIosSharedAlbum => OrderingTerm.asc(_db.localAlbumEntity.isIosSharedAlbum),
|
||||||
SortLocalAlbumsBy.isIosSharedAlbum =>
|
SortLocalAlbumsBy.name => OrderingTerm.asc(_db.localAlbumEntity.name),
|
||||||
OrderingTerm.asc(_db.localAlbumEntity.isIosSharedAlbum),
|
|
||||||
SortLocalAlbumsBy.name =>
|
|
||||||
OrderingTerm.asc(_db.localAlbumEntity.name),
|
|
||||||
SortLocalAlbumsBy.assetCount => OrderingTerm.desc(assetCount),
|
SortLocalAlbumsBy.assetCount => OrderingTerm.desc(assetCount),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -58,9 +49,7 @@ class DriftLocalAlbumRepository extends DriftDatabaseRepository {
|
|||||||
|
|
||||||
return query
|
return query
|
||||||
.map(
|
.map(
|
||||||
(row) => row
|
(row) => row.readTable(_db.localAlbumEntity).toDto(assetCount: row.read(assetCount) ?? 0),
|
||||||
.readTable(_db.localAlbumEntity)
|
|
||||||
.toDto(assetCount: row.read(assetCount) ?? 0),
|
|
||||||
)
|
)
|
||||||
.get();
|
.get();
|
||||||
}
|
}
|
||||||
@ -69,15 +58,11 @@ class DriftLocalAlbumRepository extends DriftDatabaseRepository {
|
|||||||
// Remove all assets that are only in this particular album
|
// Remove all assets that are only in this particular album
|
||||||
// We cannot remove all assets in the album because they might be in other albums in iOS
|
// We cannot remove all assets in the album because they might be in other albums in iOS
|
||||||
// That is not the case on Android since asset <-> album has one:one mapping
|
// That is not the case on Android since asset <-> album has one:one mapping
|
||||||
final assetsToDelete = _platform.isIOS
|
final assetsToDelete = _platform.isIOS ? await _getUniqueAssetsInAlbum(albumId) : await getAssetIds(albumId);
|
||||||
? await _getUniqueAssetsInAlbum(albumId)
|
|
||||||
: await getAssetIds(albumId);
|
|
||||||
await _deleteAssets(assetsToDelete);
|
await _deleteAssets(assetsToDelete);
|
||||||
|
|
||||||
// All the other assets that are still associated will be unlinked automatically on-cascade
|
// All the other assets that are still associated will be unlinked automatically on-cascade
|
||||||
await _db.managers.localAlbumEntity
|
await _db.managers.localAlbumEntity.filter((a) => a.id.equals(albumId)).delete();
|
||||||
.filter((a) => a.id.equals(albumId))
|
|
||||||
.delete();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Future<void> syncDeletes(
|
Future<void> syncDeletes(
|
||||||
@ -95,13 +80,11 @@ class DriftLocalAlbumRepository extends DriftDatabaseRepository {
|
|||||||
..join([
|
..join([
|
||||||
innerJoin(
|
innerJoin(
|
||||||
_db.localAlbumEntity,
|
_db.localAlbumEntity,
|
||||||
_db.localAlbumAssetEntity.albumId
|
_db.localAlbumAssetEntity.albumId.equalsExp(_db.localAlbumEntity.id),
|
||||||
.equalsExp(_db.localAlbumEntity.id),
|
|
||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
subQuery.where(
|
subQuery.where(
|
||||||
_db.localAlbumEntity.id.equals(albumId) &
|
_db.localAlbumEntity.id.equals(albumId) & _db.localAlbumAssetEntity.assetId.isNotIn(assetIdsToKeep),
|
||||||
_db.localAlbumAssetEntity.assetId.isNotIn(assetIdsToKeep),
|
|
||||||
);
|
);
|
||||||
return localAsset.id.isInQuery(subQuery);
|
return localAsset.id.isInQuery(subQuery);
|
||||||
});
|
});
|
||||||
@ -122,8 +105,7 @@ class DriftLocalAlbumRepository extends DriftDatabaseRepository {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return _db.transaction(() async {
|
return _db.transaction(() async {
|
||||||
await _db.localAlbumEntity
|
await _db.localAlbumEntity.insertOne(companion, onConflict: DoUpdate((_) => companion));
|
||||||
.insertOne(companion, onConflict: DoUpdate((_) => companion));
|
|
||||||
if (toUpsert.isNotEmpty) {
|
if (toUpsert.isNotEmpty) {
|
||||||
await _upsertAssets(toUpsert);
|
await _upsertAssets(toUpsert);
|
||||||
await _db.localAlbumAssetEntity.insertAll(
|
await _db.localAlbumAssetEntity.insertAll(
|
||||||
@ -142,9 +124,7 @@ class DriftLocalAlbumRepository extends DriftDatabaseRepository {
|
|||||||
|
|
||||||
Future<void> updateAll(Iterable<LocalAlbum> albums) {
|
Future<void> updateAll(Iterable<LocalAlbum> albums) {
|
||||||
return _db.transaction(() async {
|
return _db.transaction(() async {
|
||||||
await _db.localAlbumEntity
|
await _db.localAlbumEntity.update().write(const LocalAlbumEntityCompanion(marker_: Value(true)));
|
||||||
.update()
|
|
||||||
.write(const LocalAlbumEntityCompanion(marker_: Value(true)));
|
|
||||||
|
|
||||||
await _db.batch((batch) {
|
await _db.batch((batch) {
|
||||||
for (final album in albums) {
|
for (final album in albums) {
|
||||||
@ -184,8 +164,7 @@ class DriftLocalAlbumRepository extends DriftDatabaseRepository {
|
|||||||
..join([
|
..join([
|
||||||
innerJoin(
|
innerJoin(
|
||||||
_db.localAlbumEntity,
|
_db.localAlbumEntity,
|
||||||
_db.localAlbumAssetEntity.albumId
|
_db.localAlbumAssetEntity.albumId.equalsExp(_db.localAlbumEntity.id),
|
||||||
.equalsExp(_db.localAlbumEntity.id),
|
|
||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
subQuery.where(_db.localAlbumEntity.marker_.isNotNull());
|
subQuery.where(_db.localAlbumEntity.marker_.isNotNull());
|
||||||
@ -209,18 +188,14 @@ class DriftLocalAlbumRepository extends DriftDatabaseRepository {
|
|||||||
)
|
)
|
||||||
..where(_db.localAlbumAssetEntity.albumId.equals(albumId))
|
..where(_db.localAlbumAssetEntity.albumId.equals(albumId))
|
||||||
..orderBy([OrderingTerm.asc(_db.localAssetEntity.id)]);
|
..orderBy([OrderingTerm.asc(_db.localAssetEntity.id)]);
|
||||||
return query
|
return query.map((row) => row.readTable(_db.localAssetEntity).toDto()).get();
|
||||||
.map((row) => row.readTable(_db.localAssetEntity).toDto())
|
|
||||||
.get();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<String>> getAssetIds(String albumId) {
|
Future<List<String>> getAssetIds(String albumId) {
|
||||||
final query = _db.localAlbumAssetEntity.selectOnly()
|
final query = _db.localAlbumAssetEntity.selectOnly()
|
||||||
..addColumns([_db.localAlbumAssetEntity.assetId])
|
..addColumns([_db.localAlbumAssetEntity.assetId])
|
||||||
..where(_db.localAlbumAssetEntity.albumId.equals(albumId));
|
..where(_db.localAlbumAssetEntity.albumId.equals(albumId));
|
||||||
return query
|
return query.map((row) => row.read(_db.localAlbumAssetEntity.assetId)!).get();
|
||||||
.map((row) => row.read(_db.localAlbumAssetEntity.assetId)!)
|
|
||||||
.get();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> processDelta({
|
Future<void> processDelta({
|
||||||
@ -240,9 +215,7 @@ class DriftLocalAlbumRepository extends DriftDatabaseRepository {
|
|||||||
assetAlbums.cast<String, List<Object?>>().forEach((assetId, albumIds) {
|
assetAlbums.cast<String, List<Object?>>().forEach((assetId, albumIds) {
|
||||||
batch.deleteWhere(
|
batch.deleteWhere(
|
||||||
_db.localAlbumAssetEntity,
|
_db.localAlbumAssetEntity,
|
||||||
(f) =>
|
(f) => f.albumId.isNotIn(albumIds.cast<String?>().nonNulls) & f.assetId.equals(assetId),
|
||||||
f.albumId.isNotIn(albumIds.cast<String?>().nonNulls) &
|
|
||||||
f.assetId.equals(assetId),
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -273,14 +246,11 @@ class DriftLocalAlbumRepository extends DriftDatabaseRepository {
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
..where(
|
..where(
|
||||||
_db.localAlbumAssetEntity.albumId.equals(albumId) &
|
_db.localAlbumAssetEntity.albumId.equals(albumId) & _db.localAssetEntity.checksum.isNull(),
|
||||||
_db.localAssetEntity.checksum.isNull(),
|
|
||||||
)
|
)
|
||||||
..orderBy([OrderingTerm.asc(_db.localAssetEntity.id)]);
|
..orderBy([OrderingTerm.asc(_db.localAssetEntity.id)]);
|
||||||
|
|
||||||
return query
|
return query.map((row) => row.readTable(_db.localAssetEntity).toDto()).get();
|
||||||
.map((row) => row.readTable(_db.localAssetEntity).toDto())
|
|
||||||
.get();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _upsertAssets(Iterable<LocalAsset> localAssets) {
|
Future<void> _upsertAssets(Iterable<LocalAsset> localAssets) {
|
||||||
@ -364,8 +334,7 @@ class DriftLocalAlbumRepository extends DriftDatabaseRepository {
|
|||||||
..addColumns([assetId])
|
..addColumns([assetId])
|
||||||
..groupBy(
|
..groupBy(
|
||||||
[assetId],
|
[assetId],
|
||||||
having: _db.localAlbumAssetEntity.albumId.count().equals(1) &
|
having: _db.localAlbumAssetEntity.albumId.count().equals(1) & _db.localAlbumAssetEntity.albumId.equals(albumId),
|
||||||
_db.localAlbumAssetEntity.albumId.equals(albumId),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return query.map((row) => row.read(assetId)!).get();
|
return query.map((row) => row.read(assetId)!).get();
|
||||||
@ -392,9 +361,7 @@ class DriftLocalAlbumRepository extends DriftDatabaseRepository {
|
|||||||
..orderBy([OrderingTerm.asc(_db.localAssetEntity.id)])
|
..orderBy([OrderingTerm.asc(_db.localAssetEntity.id)])
|
||||||
..limit(1);
|
..limit(1);
|
||||||
|
|
||||||
final results = await query
|
final results = await query.map((row) => row.readTable(_db.localAssetEntity).toDto()).get();
|
||||||
.map((row) => row.readTable(_db.localAssetEntity).toDto())
|
|
||||||
.get();
|
|
||||||
|
|
||||||
return results.isNotEmpty ? results.first : null;
|
return results.isNotEmpty ? results.first : null;
|
||||||
}
|
}
|
||||||
|
@ -10,9 +10,7 @@ class DriftLocalAssetRepository extends DriftDatabaseRepository {
|
|||||||
const DriftLocalAssetRepository(this._db) : super(_db);
|
const DriftLocalAssetRepository(this._db) : super(_db);
|
||||||
|
|
||||||
Stream<LocalAsset?> watchAsset(String id) {
|
Stream<LocalAsset?> watchAsset(String id) {
|
||||||
final query = _db.localAssetEntity
|
final query = _db.localAssetEntity.select().addColumns([_db.remoteAssetEntity.id]).join([
|
||||||
.select()
|
|
||||||
.addColumns([_db.remoteAssetEntity.id]).join([
|
|
||||||
leftOuterJoin(
|
leftOuterJoin(
|
||||||
_db.remoteAssetEntity,
|
_db.remoteAssetEntity,
|
||||||
_db.localAssetEntity.checksum.equalsExp(_db.remoteAssetEntity.checksum),
|
_db.localAssetEntity.checksum.equalsExp(_db.remoteAssetEntity.checksum),
|
||||||
@ -58,8 +56,7 @@ class DriftLocalAssetRepository extends DriftDatabaseRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<LocalAsset?> getById(String id) {
|
Future<LocalAsset?> getById(String id) {
|
||||||
final query = _db.localAssetEntity.select()
|
final query = _db.localAssetEntity.select()..where((lae) => lae.id.equals(id));
|
||||||
..where((lae) => lae.id.equals(id));
|
|
||||||
|
|
||||||
return query.map((row) => row.toDto()).getSingleOrNull();
|
return query.map((row) => row.toDto()).getSingleOrNull();
|
||||||
}
|
}
|
||||||
@ -69,8 +66,6 @@ class DriftLocalAssetRepository extends DriftDatabaseRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<int> getHashedCount() {
|
Future<int> getHashedCount() {
|
||||||
return _db.managers.localAssetEntity
|
return _db.managers.localAssetEntity.filter((e) => e.checksum.isNull().not()).count();
|
||||||
.filter((e) => e.checksum.isNull().not())
|
|
||||||
.count();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,7 @@ class IsarLogRepository extends IsarDatabaseRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<List<LogMessage>> getAll() async {
|
Future<List<LogMessage>> getAll() async {
|
||||||
final logs =
|
final logs = await _db.loggerMessages.where().sortByCreatedAtDesc().findAll();
|
||||||
await _db.loggerMessages.where().sortByCreatedAtDesc().findAll();
|
|
||||||
return logs.map((l) => l.toDto()).toList();
|
return logs.map((l) => l.toDto()).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28,8 +27,7 @@ class IsarLogRepository extends IsarDatabaseRepository {
|
|||||||
|
|
||||||
Future<bool> insertAll(Iterable<LogMessage> logs) async {
|
Future<bool> insertAll(Iterable<LogMessage> logs) async {
|
||||||
await transaction(() async {
|
await transaction(() async {
|
||||||
final logEntities =
|
final logEntities = logs.map((log) => LoggerMessage.fromDto(log)).toList();
|
||||||
logs.map((log) => LoggerMessage.fromDto(log)).toList();
|
|
||||||
await _db.loggerMessages.putAll(logEntities);
|
await _db.loggerMessages.putAll(logEntities);
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
|
@ -22,8 +22,7 @@ class DriftMemoryRepository extends DriftDatabaseRepository {
|
|||||||
_db.remoteAssetEntity,
|
_db.remoteAssetEntity,
|
||||||
_db.remoteAssetEntity.id.equalsExp(_db.memoryAssetEntity.assetId) &
|
_db.remoteAssetEntity.id.equalsExp(_db.memoryAssetEntity.assetId) &
|
||||||
_db.remoteAssetEntity.deletedAt.isNull() &
|
_db.remoteAssetEntity.deletedAt.isNull() &
|
||||||
_db.remoteAssetEntity.visibility
|
_db.remoteAssetEntity.visibility.equalsValue(AssetVisibility.timeline),
|
||||||
.equalsValue(AssetVisibility.timeline),
|
|
||||||
),
|
),
|
||||||
])
|
])
|
||||||
..where(_db.memoryEntity.ownerId.equals(ownerId))
|
..where(_db.memoryEntity.ownerId.equals(ownerId))
|
||||||
|
@ -32,8 +32,7 @@ class DriftPartnerRepository extends DriftDatabaseRepository {
|
|||||||
|
|
||||||
// Get users who we can share our library with
|
// Get users who we can share our library with
|
||||||
Future<List<PartnerUserDto>> getAvailablePartners(String currentUserId) {
|
Future<List<PartnerUserDto>> getAvailablePartners(String currentUserId) {
|
||||||
final query = _db.select(_db.userEntity)
|
final query = _db.select(_db.userEntity)..where((row) => row.id.equals(currentUserId).not());
|
||||||
..where((row) => row.id.equals(currentUserId).not());
|
|
||||||
|
|
||||||
return query.map((user) {
|
return query.map((user) {
|
||||||
return PartnerUserDto(
|
return PartnerUserDto(
|
||||||
@ -95,20 +94,15 @@ class DriftPartnerRepository extends DriftDatabaseRepository {
|
|||||||
|
|
||||||
Future<List<String>> getAllPartnerIds(String userId) async {
|
Future<List<String>> getAllPartnerIds(String userId) async {
|
||||||
// Get users who are sharing with me (sharedWithId = userId)
|
// Get users who are sharing with me (sharedWithId = userId)
|
||||||
final sharingWithMeQuery = _db.select(_db.partnerEntity)
|
final sharingWithMeQuery = _db.select(_db.partnerEntity)..where((tbl) => tbl.sharedWithId.equals(userId));
|
||||||
..where((tbl) => tbl.sharedWithId.equals(userId));
|
final sharingWithMe = await sharingWithMeQuery.map((row) => row.sharedById).get();
|
||||||
final sharingWithMe =
|
|
||||||
await sharingWithMeQuery.map((row) => row.sharedById).get();
|
|
||||||
|
|
||||||
// Get users who I am sharing with (sharedById = userId)
|
// Get users who I am sharing with (sharedById = userId)
|
||||||
final sharingWithThemQuery = _db.select(_db.partnerEntity)
|
final sharingWithThemQuery = _db.select(_db.partnerEntity)..where((tbl) => tbl.sharedById.equals(userId));
|
||||||
..where((tbl) => tbl.sharedById.equals(userId));
|
final sharingWithThem = await sharingWithThemQuery.map((row) => row.sharedWithId).get();
|
||||||
final sharingWithThem =
|
|
||||||
await sharingWithThemQuery.map((row) => row.sharedWithId).get();
|
|
||||||
|
|
||||||
// Combine both lists and remove duplicates
|
// Combine both lists and remove duplicates
|
||||||
final allPartnerIds =
|
final allPartnerIds = <String>{...sharingWithMe, ...sharingWithThem}.toList();
|
||||||
<String>{...sharingWithMe, ...sharingWithThem}.toList();
|
|
||||||
return allPartnerIds;
|
return allPartnerIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,8 +114,7 @@ class DriftPartnerRepository extends DriftDatabaseRepository {
|
|||||||
),
|
),
|
||||||
])
|
])
|
||||||
..where(
|
..where(
|
||||||
_db.partnerEntity.sharedById.equals(partnerId) &
|
_db.partnerEntity.sharedById.equals(partnerId) & _db.partnerEntity.sharedWithId.equals(userId),
|
||||||
_db.partnerEntity.sharedWithId.equals(userId),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return query.map((row) {
|
return query.map((row) {
|
||||||
|
@ -8,8 +8,7 @@ class DriftPersonRepository extends DriftDatabaseRepository {
|
|||||||
const DriftPersonRepository(this._db) : super(_db);
|
const DriftPersonRepository(this._db) : super(_db);
|
||||||
|
|
||||||
Future<List<Person>> getAll(String userId) {
|
Future<List<Person>> getAll(String userId) {
|
||||||
final query = _db.personEntity.select()
|
final query = _db.personEntity.select()..where((e) => e.ownerId.equals(userId));
|
||||||
..where((e) => e.ownerId.equals(userId));
|
|
||||||
|
|
||||||
return query.map((person) {
|
return query.map((person) {
|
||||||
return person.toDto();
|
return person.toDto();
|
||||||
|
@ -50,8 +50,7 @@ class DriftRemoteAlbumRepository extends DriftDatabaseRepository {
|
|||||||
orderings.add(
|
orderings.add(
|
||||||
switch (sort) {
|
switch (sort) {
|
||||||
SortRemoteAlbumsBy.id => OrderingTerm.asc(_db.remoteAlbumEntity.id),
|
SortRemoteAlbumsBy.id => OrderingTerm.asc(_db.remoteAlbumEntity.id),
|
||||||
SortRemoteAlbumsBy.updatedAt =>
|
SortRemoteAlbumsBy.updatedAt => OrderingTerm.desc(_db.remoteAlbumEntity.updatedAt),
|
||||||
OrderingTerm.desc(_db.remoteAlbumEntity.updatedAt),
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -137,8 +136,7 @@ class DriftRemoteAlbumRepository extends DriftDatabaseRepository {
|
|||||||
..join([
|
..join([
|
||||||
innerJoin(
|
innerJoin(
|
||||||
_db.remoteAssetEntity,
|
_db.remoteAssetEntity,
|
||||||
_db.remoteAssetEntity.id
|
_db.remoteAssetEntity.id.equalsExp(_db.remoteAlbumAssetEntity.assetId),
|
||||||
.equalsExp(_db.remoteAlbumAssetEntity.assetId),
|
|
||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -150,9 +148,8 @@ class DriftRemoteAlbumRepository extends DriftDatabaseRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<List<UserDto>> getSharedUsers(String albumId) async {
|
Future<List<UserDto>> getSharedUsers(String albumId) async {
|
||||||
final albumUserRows = await (_db.select(_db.remoteAlbumUserEntity)
|
final albumUserRows =
|
||||||
..where((row) => row.albumId.equals(albumId)))
|
await (_db.select(_db.remoteAlbumUserEntity)..where((row) => row.albumId.equals(albumId))).get();
|
||||||
.get();
|
|
||||||
|
|
||||||
if (albumUserRows.isEmpty) {
|
if (albumUserRows.isEmpty) {
|
||||||
return [];
|
return [];
|
||||||
@ -166,9 +163,7 @@ class DriftRemoteAlbumRepository extends DriftDatabaseRepository {
|
|||||||
id: user.id,
|
id: user.id,
|
||||||
email: user.email,
|
email: user.email,
|
||||||
name: user.name,
|
name: user.name,
|
||||||
profileImagePath: user.profileImagePath?.isEmpty == true
|
profileImagePath: user.profileImagePath?.isEmpty == true ? null : user.profileImagePath,
|
||||||
? null
|
|
||||||
: user.profileImagePath,
|
|
||||||
isAdmin: user.isAdmin,
|
isAdmin: user.isAdmin,
|
||||||
updatedAt: user.updatedAt,
|
updatedAt: user.updatedAt,
|
||||||
quotaSizeInBytes: user.quotaSizeInBytes ?? 0,
|
quotaSizeInBytes: user.quotaSizeInBytes ?? 0,
|
||||||
@ -191,9 +186,7 @@ class DriftRemoteAlbumRepository extends DriftDatabaseRepository {
|
|||||||
])
|
])
|
||||||
..where(_db.remoteAlbumAssetEntity.albumId.equals(albumId));
|
..where(_db.remoteAlbumAssetEntity.albumId.equals(albumId));
|
||||||
|
|
||||||
return query
|
return query.map((row) => row.readTable(_db.remoteAssetEntity).toDto()).get();
|
||||||
.map((row) => row.readTable(_db.remoteAssetEntity).toDto())
|
|
||||||
.get();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<int> addAssets(String albumId, List<String> assetIds) async {
|
Future<int> addAssets(String albumId, List<String> assetIds) async {
|
||||||
|
@ -2,8 +2,7 @@ import 'package:drift/drift.dart';
|
|||||||
import 'package:immich_mobile/domain/models/asset/base_asset.model.dart';
|
import 'package:immich_mobile/domain/models/asset/base_asset.model.dart';
|
||||||
import 'package:immich_mobile/domain/models/exif.model.dart';
|
import 'package:immich_mobile/domain/models/exif.model.dart';
|
||||||
import 'package:immich_mobile/domain/models/stack.model.dart';
|
import 'package:immich_mobile/domain/models/stack.model.dart';
|
||||||
import 'package:immich_mobile/infrastructure/entities/exif.entity.dart'
|
import 'package:immich_mobile/infrastructure/entities/exif.entity.dart' hide ExifInfo;
|
||||||
hide ExifInfo;
|
|
||||||
import 'package:immich_mobile/infrastructure/entities/exif.entity.drift.dart';
|
import 'package:immich_mobile/infrastructure/entities/exif.entity.drift.dart';
|
||||||
import 'package:immich_mobile/infrastructure/entities/remote_asset.entity.dart';
|
import 'package:immich_mobile/infrastructure/entities/remote_asset.entity.dart';
|
||||||
import 'package:immich_mobile/infrastructure/entities/remote_asset.entity.drift.dart';
|
import 'package:immich_mobile/infrastructure/entities/remote_asset.entity.drift.dart';
|
||||||
@ -22,8 +21,7 @@ class RemoteAssetRepository extends DriftDatabaseRepository {
|
|||||||
(row) =>
|
(row) =>
|
||||||
_db.remoteAssetEntity.ownerId.equals(userId) &
|
_db.remoteAssetEntity.ownerId.equals(userId) &
|
||||||
_db.remoteAssetEntity.deletedAt.isNull() &
|
_db.remoteAssetEntity.deletedAt.isNull() &
|
||||||
_db.remoteAssetEntity.visibility
|
_db.remoteAssetEntity.visibility.equalsValue(AssetVisibility.timeline),
|
||||||
.equalsValue(AssetVisibility.timeline),
|
|
||||||
)
|
)
|
||||||
..orderBy([(row) => OrderingTerm.desc(row.createdAt)])
|
..orderBy([(row) => OrderingTerm.desc(row.createdAt)])
|
||||||
..limit(10);
|
..limit(10);
|
||||||
@ -57,8 +55,7 @@ class RemoteAssetRepository extends DriftDatabaseRepository {
|
|||||||
|
|
||||||
final query = _db.remoteAssetEntity.select()
|
final query = _db.remoteAssetEntity.select()
|
||||||
..where(
|
..where(
|
||||||
(row) =>
|
(row) => row.stackId.equals(asset.stackId!) & row.id.equals(asset.id).not(),
|
||||||
row.stackId.equals(asset.stackId!) & row.id.equals(asset.id).not(),
|
|
||||||
)
|
)
|
||||||
..orderBy([(row) => OrderingTerm.desc(row.createdAt)]);
|
..orderBy([(row) => OrderingTerm.desc(row.createdAt)]);
|
||||||
|
|
||||||
@ -74,16 +71,14 @@ class RemoteAssetRepository extends DriftDatabaseRepository {
|
|||||||
|
|
||||||
Future<List<(String, String)>> getPlaces() {
|
Future<List<(String, String)>> getPlaces() {
|
||||||
final asset = Subquery(
|
final asset = Subquery(
|
||||||
_db.remoteAssetEntity.select()
|
_db.remoteAssetEntity.select()..orderBy([(row) => OrderingTerm.desc(row.createdAt)]),
|
||||||
..orderBy([(row) => OrderingTerm.desc(row.createdAt)]),
|
|
||||||
"asset",
|
"asset",
|
||||||
);
|
);
|
||||||
|
|
||||||
final query = asset.selectOnly().join([
|
final query = asset.selectOnly().join([
|
||||||
innerJoin(
|
innerJoin(
|
||||||
_db.remoteExifEntity,
|
_db.remoteExifEntity,
|
||||||
_db.remoteExifEntity.assetId
|
_db.remoteExifEntity.assetId.equalsExp(asset.ref(_db.remoteAssetEntity.id)),
|
||||||
.equalsExp(asset.ref(_db.remoteAssetEntity.id)),
|
|
||||||
useColumns: false,
|
useColumns: false,
|
||||||
),
|
),
|
||||||
])
|
])
|
||||||
@ -94,9 +89,7 @@ class RemoteAssetRepository extends DriftDatabaseRepository {
|
|||||||
..where(
|
..where(
|
||||||
_db.remoteExifEntity.city.isNotNull() &
|
_db.remoteExifEntity.city.isNotNull() &
|
||||||
asset.ref(_db.remoteAssetEntity.deletedAt).isNull() &
|
asset.ref(_db.remoteAssetEntity.deletedAt).isNull() &
|
||||||
asset
|
asset.ref(_db.remoteAssetEntity.visibility).equals(AssetVisibility.timeline.index),
|
||||||
.ref(_db.remoteAssetEntity.visibility)
|
|
||||||
.equals(AssetVisibility.timeline.index),
|
|
||||||
)
|
)
|
||||||
..groupBy([_db.remoteExifEntity.city])
|
..groupBy([_db.remoteExifEntity.city])
|
||||||
..orderBy([OrderingTerm.asc(_db.remoteExifEntity.city)]);
|
..orderBy([OrderingTerm.asc(_db.remoteExifEntity.city)]);
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import 'package:immich_mobile/domain/models/asset/base_asset.model.dart'
|
import 'package:immich_mobile/domain/models/asset/base_asset.model.dart' hide AssetVisibility;
|
||||||
hide AssetVisibility;
|
|
||||||
import 'package:immich_mobile/infrastructure/repositories/api.repository.dart';
|
import 'package:immich_mobile/infrastructure/repositories/api.repository.dart';
|
||||||
import 'package:immich_mobile/models/search/search_filter.model.dart';
|
import 'package:immich_mobile/models/search/search_filter.model.dart';
|
||||||
import 'package:openapi/api.dart';
|
import 'package:openapi/api.dart';
|
||||||
@ -28,9 +27,7 @@ class SearchApiRepository extends ApiRepository {
|
|||||||
model: filter.camera.model,
|
model: filter.camera.model,
|
||||||
takenAfter: filter.date.takenAfter,
|
takenAfter: filter.date.takenAfter,
|
||||||
takenBefore: filter.date.takenBefore,
|
takenBefore: filter.date.takenBefore,
|
||||||
visibility: filter.display.isArchive
|
visibility: filter.display.isArchive ? AssetVisibility.archive : AssetVisibility.timeline,
|
||||||
? AssetVisibility.archive
|
|
||||||
: AssetVisibility.timeline,
|
|
||||||
isFavorite: filter.display.isFavorite ? true : null,
|
isFavorite: filter.display.isFavorite ? true : null,
|
||||||
isNotInAlbum: filter.display.isNotInAlbum ? true : null,
|
isNotInAlbum: filter.display.isNotInAlbum ? true : null,
|
||||||
personIds: filter.people.map((e) => e.id).toList(),
|
personIds: filter.people.map((e) => e.id).toList(),
|
||||||
@ -43,23 +40,16 @@ class SearchApiRepository extends ApiRepository {
|
|||||||
|
|
||||||
return _api.searchAssets(
|
return _api.searchAssets(
|
||||||
MetadataSearchDto(
|
MetadataSearchDto(
|
||||||
originalFileName: filter.filename != null && filter.filename!.isNotEmpty
|
originalFileName: filter.filename != null && filter.filename!.isNotEmpty ? filter.filename : null,
|
||||||
? filter.filename
|
|
||||||
: null,
|
|
||||||
country: filter.location.country,
|
country: filter.location.country,
|
||||||
description:
|
description: filter.description != null && filter.description!.isNotEmpty ? filter.description : null,
|
||||||
filter.description != null && filter.description!.isNotEmpty
|
|
||||||
? filter.description
|
|
||||||
: null,
|
|
||||||
state: filter.location.state,
|
state: filter.location.state,
|
||||||
city: filter.location.city,
|
city: filter.location.city,
|
||||||
make: filter.camera.make,
|
make: filter.camera.make,
|
||||||
model: filter.camera.model,
|
model: filter.camera.model,
|
||||||
takenAfter: filter.date.takenAfter,
|
takenAfter: filter.date.takenAfter,
|
||||||
takenBefore: filter.date.takenBefore,
|
takenBefore: filter.date.takenBefore,
|
||||||
visibility: filter.display.isArchive
|
visibility: filter.display.isArchive ? AssetVisibility.archive : AssetVisibility.timeline,
|
||||||
? AssetVisibility.archive
|
|
||||||
: AssetVisibility.timeline,
|
|
||||||
isFavorite: filter.display.isFavorite ? true : null,
|
isFavorite: filter.display.isFavorite ? true : null,
|
||||||
isNotInAlbum: filter.display.isNotInAlbum ? true : null,
|
isNotInAlbum: filter.display.isNotInAlbum ? true : null,
|
||||||
personIds: filter.people.map((e) => e.id).toList(),
|
personIds: filter.people.map((e) => e.id).toList(),
|
||||||
|
@ -8,8 +8,7 @@ class DriftStackRepository extends DriftDatabaseRepository {
|
|||||||
const DriftStackRepository(this._db) : super(_db);
|
const DriftStackRepository(this._db) : super(_db);
|
||||||
|
|
||||||
Future<List<Stack>> getAll(String userId) {
|
Future<List<Stack>> getAll(String userId) {
|
||||||
final query = _db.stackEntity.select()
|
final query = _db.stackEntity.select()..where((e) => e.ownerId.equals(userId));
|
||||||
..where((e) => e.ownerId.equals(userId));
|
|
||||||
|
|
||||||
return query.map((stack) {
|
return query.map((stack) {
|
||||||
return stack.toDto();
|
return stack.toDto();
|
||||||
|
@ -63,23 +63,17 @@ class IsarStoreRepository extends IsarDatabaseRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<StoreDto<Object>> _toUpdateEvent(StoreValue entity) async {
|
Future<StoreDto<Object>> _toUpdateEvent(StoreValue entity) async {
|
||||||
final key = StoreKey.values.firstWhere((e) => e.id == entity.id)
|
final key = StoreKey.values.firstWhere((e) => e.id == entity.id) as StoreKey<Object>;
|
||||||
as StoreKey<Object>;
|
|
||||||
final value = await _toValue(key, entity);
|
final value = await _toValue(key, entity);
|
||||||
return StoreDto(key, value);
|
return StoreDto(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<T?> _toValue<T>(StoreKey<T> key, StoreValue entity) async =>
|
Future<T?> _toValue<T>(StoreKey<T> key, StoreValue entity) async => switch (key.type) {
|
||||||
switch (key.type) {
|
|
||||||
const (int) => entity.intValue,
|
const (int) => entity.intValue,
|
||||||
const (String) => entity.strValue,
|
const (String) => entity.strValue,
|
||||||
const (bool) => entity.intValue == 1,
|
const (bool) => entity.intValue == 1,
|
||||||
const (DateTime) => entity.intValue == null
|
const (DateTime) => entity.intValue == null ? null : DateTime.fromMillisecondsSinceEpoch(entity.intValue!),
|
||||||
? null
|
const (UserDto) => entity.strValue == null ? null : await IsarUserRepository(_db).getByUserId(entity.strValue!),
|
||||||
: DateTime.fromMillisecondsSinceEpoch(entity.intValue!),
|
|
||||||
const (UserDto) => entity.strValue == null
|
|
||||||
? null
|
|
||||||
: await IsarUserRepository(_db).getByUserId(entity.strValue!),
|
|
||||||
_ => null,
|
_ => null,
|
||||||
} as T?;
|
} as T?;
|
||||||
|
|
||||||
@ -101,10 +95,7 @@ class IsarStoreRepository extends IsarDatabaseRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<List<StoreDto<Object>>> getAll() async {
|
Future<List<StoreDto<Object>>> getAll() async {
|
||||||
final entities = await _db.storeValues
|
final entities = await _db.storeValues.filter().anyOf(validStoreKeys, (query, id) => query.idEqualTo(id)).findAll();
|
||||||
.filter()
|
|
||||||
.anyOf(validStoreKeys, (query, id) => query.idEqualTo(id))
|
|
||||||
.findAll();
|
|
||||||
return Future.wait(entities.map((e) => _toUpdateEvent(e)).toList());
|
return Future.wait(entities.map((e) => _toUpdateEvent(e)).toList());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -112,8 +112,7 @@ class SyncApiRepository {
|
|||||||
client.close();
|
client.close();
|
||||||
}
|
}
|
||||||
stopwatch.stop();
|
stopwatch.stop();
|
||||||
_logger
|
_logger.info("Remote Sync completed in ${stopwatch.elapsed.inMilliseconds}ms");
|
||||||
.info("Remote Sync completed in ${stopwatch.elapsed.inMilliseconds}ms");
|
|
||||||
DLog.log("Remote Sync completed in ${stopwatch.elapsed.inMilliseconds}ms");
|
DLog.log("Remote Sync completed in ${stopwatch.elapsed.inMilliseconds}ms");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,8 +31,7 @@ class SyncStreamRepository extends DriftDatabaseRepository {
|
|||||||
|
|
||||||
Future<void> deleteUsersV1(Iterable<SyncUserDeleteV1> data) async {
|
Future<void> deleteUsersV1(Iterable<SyncUserDeleteV1> data) async {
|
||||||
try {
|
try {
|
||||||
await _db.userEntity
|
await _db.userEntity.deleteWhere((row) => row.id.isIn(data.map((e) => e.userId)));
|
||||||
.deleteWhere((row) => row.id.isIn(data.map((e) => e.userId)));
|
|
||||||
} catch (error, stack) {
|
} catch (error, stack) {
|
||||||
_logger.severe('Error: SyncUserDeleteV1', error, stack);
|
_logger.severe('Error: SyncUserDeleteV1', error, stack);
|
||||||
rethrow;
|
rethrow;
|
||||||
@ -84,8 +83,7 @@ class SyncStreamRepository extends DriftDatabaseRepository {
|
|||||||
try {
|
try {
|
||||||
await _db.batch((batch) {
|
await _db.batch((batch) {
|
||||||
for (final partner in data) {
|
for (final partner in data) {
|
||||||
final companion =
|
final companion = PartnerEntityCompanion(inTimeline: Value(partner.inTimeline));
|
||||||
PartnerEntityCompanion(inTimeline: Value(partner.inTimeline));
|
|
||||||
|
|
||||||
batch.insert(
|
batch.insert(
|
||||||
_db.partnerEntity,
|
_db.partnerEntity,
|
||||||
@ -129,8 +127,7 @@ class SyncStreamRepository extends DriftDatabaseRepository {
|
|||||||
type: Value(asset.type.toAssetType()),
|
type: Value(asset.type.toAssetType()),
|
||||||
createdAt: Value.absentIfNull(asset.fileCreatedAt),
|
createdAt: Value.absentIfNull(asset.fileCreatedAt),
|
||||||
updatedAt: Value.absentIfNull(asset.fileModifiedAt),
|
updatedAt: Value.absentIfNull(asset.fileModifiedAt),
|
||||||
durationInSeconds:
|
durationInSeconds: Value(asset.duration?.toDuration()?.inSeconds ?? 0),
|
||||||
Value(asset.duration?.toDuration()?.inSeconds ?? 0),
|
|
||||||
checksum: Value(asset.checksum),
|
checksum: Value(asset.checksum),
|
||||||
isFavorite: Value(asset.isFavorite),
|
isFavorite: Value(asset.isFavorite),
|
||||||
ownerId: Value(asset.ownerId),
|
ownerId: Value(asset.ownerId),
|
||||||
@ -662,9 +659,7 @@ extension on String {
|
|||||||
extension on String {
|
extension on String {
|
||||||
Duration? toDuration() {
|
Duration? toDuration() {
|
||||||
try {
|
try {
|
||||||
final parts = split(':')
|
final parts = split(':').map((e) => double.parse(e).toInt()).toList(growable: false);
|
||||||
.map((e) => double.parse(e).toInt())
|
|
||||||
.toList(growable: false);
|
|
||||||
|
|
||||||
return Duration(hours: parts[0], minutes: parts[1], seconds: parts[2]);
|
return Duration(hours: parts[0], minutes: parts[1], seconds: parts[2]);
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
|
@ -22,8 +22,7 @@ class DriftTimelineRepository extends DriftDatabaseRepository {
|
|||||||
final query = _db.partnerEntity.selectOnly()
|
final query = _db.partnerEntity.selectOnly()
|
||||||
..addColumns([_db.partnerEntity.sharedById])
|
..addColumns([_db.partnerEntity.sharedById])
|
||||||
..where(
|
..where(
|
||||||
_db.partnerEntity.inTimeline.equals(true) &
|
_db.partnerEntity.inTimeline.equals(true) & _db.partnerEntity.sharedWithId.equals(userId),
|
||||||
_db.partnerEntity.sharedWithId.equals(userId),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return query
|
return query
|
||||||
@ -173,8 +172,7 @@ class DriftTimelineRepository extends DriftDatabaseRepository {
|
|||||||
),
|
),
|
||||||
leftOuterJoin(
|
leftOuterJoin(
|
||||||
_db.remoteAssetEntity,
|
_db.remoteAssetEntity,
|
||||||
_db.localAssetEntity.checksum
|
_db.localAssetEntity.checksum.equalsExp(_db.remoteAssetEntity.checksum),
|
||||||
.equalsExp(_db.remoteAssetEntity.checksum),
|
|
||||||
useColumns: false,
|
useColumns: false,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -219,10 +217,7 @@ class DriftTimelineRepository extends DriftDatabaseRepository {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return (_db.remoteAlbumEntity.select()
|
return (_db.remoteAlbumEntity.select()..where((row) => row.id.equals(albumId))).watch().switchMap((albums) {
|
||||||
..where((row) => row.id.equals(albumId)))
|
|
||||||
.watch()
|
|
||||||
.switchMap((albums) {
|
|
||||||
if (albums.isEmpty) {
|
if (albums.isEmpty) {
|
||||||
return Stream.value(<Bucket>[]);
|
return Stream.value(<Bucket>[]);
|
||||||
}
|
}
|
||||||
@ -237,14 +232,12 @@ class DriftTimelineRepository extends DriftDatabaseRepository {
|
|||||||
..join([
|
..join([
|
||||||
innerJoin(
|
innerJoin(
|
||||||
_db.remoteAlbumAssetEntity,
|
_db.remoteAlbumAssetEntity,
|
||||||
_db.remoteAlbumAssetEntity.assetId
|
_db.remoteAlbumAssetEntity.assetId.equalsExp(_db.remoteAssetEntity.id),
|
||||||
.equalsExp(_db.remoteAssetEntity.id),
|
|
||||||
useColumns: false,
|
useColumns: false,
|
||||||
),
|
),
|
||||||
])
|
])
|
||||||
..where(
|
..where(
|
||||||
_db.remoteAssetEntity.deletedAt.isNull() &
|
_db.remoteAssetEntity.deletedAt.isNull() & _db.remoteAlbumAssetEntity.albumId.equals(albumId),
|
||||||
_db.remoteAlbumAssetEntity.albumId.equals(albumId),
|
|
||||||
)
|
)
|
||||||
..groupBy([dateExp]);
|
..groupBy([dateExp]);
|
||||||
|
|
||||||
@ -270,9 +263,7 @@ class DriftTimelineRepository extends DriftDatabaseRepository {
|
|||||||
required int offset,
|
required int offset,
|
||||||
required int count,
|
required int count,
|
||||||
}) async {
|
}) async {
|
||||||
final albumData = await (_db.remoteAlbumEntity.select()
|
final albumData = await (_db.remoteAlbumEntity.select()..where((row) => row.id.equals(albumId))).getSingleOrNull();
|
||||||
..where((row) => row.id.equals(albumId)))
|
|
||||||
.getSingleOrNull();
|
|
||||||
|
|
||||||
// If album doesn't exist (was deleted), return empty list
|
// If album doesn't exist (was deleted), return empty list
|
||||||
if (albumData == null) {
|
if (albumData == null) {
|
||||||
@ -285,14 +276,12 @@ class DriftTimelineRepository extends DriftDatabaseRepository {
|
|||||||
[
|
[
|
||||||
innerJoin(
|
innerJoin(
|
||||||
_db.remoteAlbumAssetEntity,
|
_db.remoteAlbumAssetEntity,
|
||||||
_db.remoteAlbumAssetEntity.assetId
|
_db.remoteAlbumAssetEntity.assetId.equalsExp(_db.remoteAssetEntity.id),
|
||||||
.equalsExp(_db.remoteAssetEntity.id),
|
|
||||||
useColumns: false,
|
useColumns: false,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)..where(
|
)..where(
|
||||||
_db.remoteAssetEntity.deletedAt.isNull() &
|
_db.remoteAssetEntity.deletedAt.isNull() & _db.remoteAlbumAssetEntity.albumId.equals(albumId),
|
||||||
_db.remoteAlbumAssetEntity.albumId.equals(albumId),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (isAscending) {
|
if (isAscending) {
|
||||||
@ -303,62 +292,44 @@ class DriftTimelineRepository extends DriftDatabaseRepository {
|
|||||||
|
|
||||||
query.limit(count, offset: offset);
|
query.limit(count, offset: offset);
|
||||||
|
|
||||||
return query
|
return query.map((row) => row.readTable(_db.remoteAssetEntity).toDto()).get();
|
||||||
.map((row) => row.readTable(_db.remoteAssetEntity).toDto())
|
|
||||||
.get();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TimelineQuery fromAssets(List<BaseAsset> assets) => (
|
TimelineQuery fromAssets(List<BaseAsset> assets) => (
|
||||||
bucketSource: () => Stream.value(_generateBuckets(assets.length)),
|
bucketSource: () => Stream.value(_generateBuckets(assets.length)),
|
||||||
assetSource: (offset, count) =>
|
assetSource: (offset, count) => Future.value(assets.skip(offset).take(count).toList()),
|
||||||
Future.value(assets.skip(offset).take(count).toList()),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
TimelineQuery remote(String ownerId, GroupAssetsBy groupBy) =>
|
TimelineQuery remote(String ownerId, GroupAssetsBy groupBy) => _remoteQueryBuilder(
|
||||||
_remoteQueryBuilder(
|
|
||||||
filter: (row) =>
|
filter: (row) =>
|
||||||
row.deletedAt.isNull() &
|
row.deletedAt.isNull() & row.visibility.equalsValue(AssetVisibility.timeline) & row.ownerId.equals(ownerId),
|
||||||
row.visibility.equalsValue(AssetVisibility.timeline) &
|
|
||||||
row.ownerId.equals(ownerId),
|
|
||||||
groupBy: groupBy,
|
groupBy: groupBy,
|
||||||
);
|
);
|
||||||
|
|
||||||
TimelineQuery favorite(String userId, GroupAssetsBy groupBy) =>
|
TimelineQuery favorite(String userId, GroupAssetsBy groupBy) => _remoteQueryBuilder(
|
||||||
_remoteQueryBuilder(
|
filter: (row) => row.deletedAt.isNull() & row.isFavorite.equals(true) & row.ownerId.equals(userId),
|
||||||
filter: (row) =>
|
|
||||||
row.deletedAt.isNull() &
|
|
||||||
row.isFavorite.equals(true) &
|
|
||||||
row.ownerId.equals(userId),
|
|
||||||
groupBy: groupBy,
|
groupBy: groupBy,
|
||||||
);
|
);
|
||||||
|
|
||||||
TimelineQuery trash(String userId, GroupAssetsBy groupBy) =>
|
TimelineQuery trash(String userId, GroupAssetsBy groupBy) => _remoteQueryBuilder(
|
||||||
_remoteQueryBuilder(
|
|
||||||
filter: (row) => row.deletedAt.isNotNull() & row.ownerId.equals(userId),
|
filter: (row) => row.deletedAt.isNotNull() & row.ownerId.equals(userId),
|
||||||
groupBy: groupBy,
|
groupBy: groupBy,
|
||||||
joinLocal: true,
|
joinLocal: true,
|
||||||
);
|
);
|
||||||
|
|
||||||
TimelineQuery archived(String userId, GroupAssetsBy groupBy) =>
|
TimelineQuery archived(String userId, GroupAssetsBy groupBy) => _remoteQueryBuilder(
|
||||||
_remoteQueryBuilder(
|
|
||||||
filter: (row) =>
|
filter: (row) =>
|
||||||
row.deletedAt.isNull() &
|
row.deletedAt.isNull() & row.ownerId.equals(userId) & row.visibility.equalsValue(AssetVisibility.archive),
|
||||||
row.ownerId.equals(userId) &
|
|
||||||
row.visibility.equalsValue(AssetVisibility.archive),
|
|
||||||
groupBy: groupBy,
|
groupBy: groupBy,
|
||||||
);
|
);
|
||||||
|
|
||||||
TimelineQuery locked(String userId, GroupAssetsBy groupBy) =>
|
TimelineQuery locked(String userId, GroupAssetsBy groupBy) => _remoteQueryBuilder(
|
||||||
_remoteQueryBuilder(
|
|
||||||
filter: (row) =>
|
filter: (row) =>
|
||||||
row.deletedAt.isNull() &
|
row.deletedAt.isNull() & row.visibility.equalsValue(AssetVisibility.locked) & row.ownerId.equals(userId),
|
||||||
row.visibility.equalsValue(AssetVisibility.locked) &
|
|
||||||
row.ownerId.equals(userId),
|
|
||||||
groupBy: groupBy,
|
groupBy: groupBy,
|
||||||
);
|
);
|
||||||
|
|
||||||
TimelineQuery video(String userId, GroupAssetsBy groupBy) =>
|
TimelineQuery video(String userId, GroupAssetsBy groupBy) => _remoteQueryBuilder(
|
||||||
_remoteQueryBuilder(
|
|
||||||
filter: (row) =>
|
filter: (row) =>
|
||||||
row.deletedAt.isNull() &
|
row.deletedAt.isNull() &
|
||||||
row.type.equalsValue(AssetType.video) &
|
row.type.equalsValue(AssetType.video) &
|
||||||
@ -405,8 +376,7 @@ class DriftTimelineRepository extends DriftDatabaseRepository {
|
|||||||
..where(
|
..where(
|
||||||
_db.remoteExifEntity.city.equals(place) &
|
_db.remoteExifEntity.city.equals(place) &
|
||||||
_db.remoteAssetEntity.deletedAt.isNull() &
|
_db.remoteAssetEntity.deletedAt.isNull() &
|
||||||
_db.remoteAssetEntity.visibility
|
_db.remoteAssetEntity.visibility.equalsValue(AssetVisibility.timeline),
|
||||||
.equalsValue(AssetVisibility.timeline),
|
|
||||||
)
|
)
|
||||||
..groupBy([dateExp])
|
..groupBy([dateExp])
|
||||||
..orderBy([OrderingTerm.desc(dateExp)]);
|
..orderBy([OrderingTerm.desc(dateExp)]);
|
||||||
@ -434,15 +404,12 @@ class DriftTimelineRepository extends DriftDatabaseRepository {
|
|||||||
)
|
)
|
||||||
..where(
|
..where(
|
||||||
_db.remoteAssetEntity.deletedAt.isNull() &
|
_db.remoteAssetEntity.deletedAt.isNull() &
|
||||||
_db.remoteAssetEntity.visibility
|
_db.remoteAssetEntity.visibility.equalsValue(AssetVisibility.timeline) &
|
||||||
.equalsValue(AssetVisibility.timeline) &
|
|
||||||
_db.remoteExifEntity.city.equals(place),
|
_db.remoteExifEntity.city.equals(place),
|
||||||
)
|
)
|
||||||
..orderBy([OrderingTerm.desc(_db.remoteAssetEntity.createdAt)])
|
..orderBy([OrderingTerm.desc(_db.remoteAssetEntity.createdAt)])
|
||||||
..limit(count, offset: offset);
|
..limit(count, offset: offset);
|
||||||
return query
|
return query.map((row) => row.readTable(_db.remoteAssetEntity).toDto()).get();
|
||||||
.map((row) => row.readTable(_db.remoteAssetEntity).toDto())
|
|
||||||
.get();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TimelineQuery _remoteQueryBuilder({
|
TimelineQuery _remoteQueryBuilder({
|
||||||
@ -496,8 +463,7 @@ class DriftTimelineRepository extends DriftDatabaseRepository {
|
|||||||
final query = _db.remoteAssetEntity.select().join([
|
final query = _db.remoteAssetEntity.select().join([
|
||||||
leftOuterJoin(
|
leftOuterJoin(
|
||||||
_db.localAssetEntity,
|
_db.localAssetEntity,
|
||||||
_db.remoteAssetEntity.checksum
|
_db.remoteAssetEntity.checksum.equalsExp(_db.localAssetEntity.checksum),
|
||||||
.equalsExp(_db.localAssetEntity.checksum),
|
|
||||||
useColumns: false,
|
useColumns: false,
|
||||||
),
|
),
|
||||||
])
|
])
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import 'package:immich_mobile/constants/enums.dart';
|
import 'package:immich_mobile/constants/enums.dart';
|
||||||
import 'package:immich_mobile/domain/models/user.model.dart';
|
import 'package:immich_mobile/domain/models/user.model.dart';
|
||||||
import 'package:immich_mobile/infrastructure/entities/user.entity.dart'
|
import 'package:immich_mobile/infrastructure/entities/user.entity.dart' as entity;
|
||||||
as entity;
|
|
||||||
import 'package:immich_mobile/infrastructure/repositories/db.repository.dart';
|
import 'package:immich_mobile/infrastructure/repositories/db.repository.dart';
|
||||||
import 'package:isar/isar.dart';
|
import 'package:isar/isar.dart';
|
||||||
|
|
||||||
|
@ -11,8 +11,7 @@ class UserApiRepository extends ApiRepository {
|
|||||||
const UserApiRepository(this._api);
|
const UserApiRepository(this._api);
|
||||||
|
|
||||||
Future<UserDto?> getMyUser() async {
|
Future<UserDto?> getMyUser() async {
|
||||||
final (adminDto, preferenceDto) =
|
final (adminDto, preferenceDto) = await (_api.getMyUser(), _api.getMyPreferences()).wait;
|
||||||
await (_api.getMyUser(), _api.getMyPreferences()).wait;
|
|
||||||
if (adminDto == null) return null;
|
if (adminDto == null) return null;
|
||||||
|
|
||||||
return UserConverter.fromAdminDto(adminDto, preferenceDto);
|
return UserConverter.fromAdminDto(adminDto, preferenceDto);
|
||||||
|
@ -8,8 +8,7 @@ class DriftUserMetadataRepository extends DriftDatabaseRepository {
|
|||||||
const DriftUserMetadataRepository(this._db) : super(_db);
|
const DriftUserMetadataRepository(this._db) : super(_db);
|
||||||
|
|
||||||
Future<List<UserMetadata>> getUserMetadata(String userId) {
|
Future<List<UserMetadata>> getUserMetadata(String userId) {
|
||||||
final query = _db.userMetadataEntity.select()
|
final query = _db.userMetadataEntity.select()..where((e) => e.userId.equals(userId));
|
||||||
..where((e) => e.userId.equals(userId));
|
|
||||||
|
|
||||||
return query.map((userMetadata) {
|
return query.map((userMetadata) {
|
||||||
return userMetadata.toDto();
|
return userMetadata.toDto();
|
||||||
|
@ -126,8 +126,7 @@ class ImmichApp extends ConsumerStatefulWidget {
|
|||||||
ImmichAppState createState() => ImmichAppState();
|
ImmichAppState createState() => ImmichAppState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class ImmichAppState extends ConsumerState<ImmichApp>
|
class ImmichAppState extends ConsumerState<ImmichApp> with WidgetsBindingObserver {
|
||||||
with WidgetsBindingObserver {
|
|
||||||
@override
|
@override
|
||||||
void didChangeAppLifecycleState(AppLifecycleState state) {
|
void didChangeAppLifecycleState(AppLifecycleState state) {
|
||||||
switch (state) {
|
switch (state) {
|
||||||
@ -168,9 +167,7 @@ class ImmichAppState extends ConsumerState<ImmichApp>
|
|||||||
// Android 8 does not support transparent app bars
|
// Android 8 does not support transparent app bars
|
||||||
final info = await DeviceInfoPlugin().androidInfo;
|
final info = await DeviceInfoPlugin().androidInfo;
|
||||||
if (info.version.sdkInt <= 26) {
|
if (info.version.sdkInt <= 26) {
|
||||||
overlayStyle = context.isDarkTheme
|
overlayStyle = context.isDarkTheme ? SystemUiOverlayStyle.dark : SystemUiOverlayStyle.light;
|
||||||
? SystemUiOverlayStyle.dark
|
|
||||||
: SystemUiOverlayStyle.light;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SystemChrome.setSystemUIOverlayStyle(overlayStyle);
|
SystemChrome.setSystemUIOverlayStyle(overlayStyle);
|
||||||
@ -222,8 +219,7 @@ class ImmichAppState extends ConsumerState<ImmichApp>
|
|||||||
final deepLinkHandler = ref.read(deepLinkServiceProvider);
|
final deepLinkHandler = ref.read(deepLinkServiceProvider);
|
||||||
final currentRouteName = ref.read(currentRouteNameProvider.notifier).state;
|
final currentRouteName = ref.read(currentRouteNameProvider.notifier).state;
|
||||||
|
|
||||||
final isColdStart =
|
final isColdStart = currentRouteName == null || currentRouteName == SplashScreenRoute.name;
|
||||||
currentRouteName == null || currentRouteName == SplashScreenRoute.name;
|
|
||||||
|
|
||||||
if (deepLink.uri.scheme == "immich") {
|
if (deepLink.uri.scheme == "immich") {
|
||||||
final proposedRoute = await deepLinkHandler.handleScheme(
|
final proposedRoute = await deepLinkHandler.handleScheme(
|
||||||
@ -299,8 +295,7 @@ class ImmichAppState extends ConsumerState<ImmichApp>
|
|||||||
),
|
),
|
||||||
routerConfig: router.config(
|
routerConfig: router.config(
|
||||||
deepLinkBuilder: _deepLinkBuilder,
|
deepLinkBuilder: _deepLinkBuilder,
|
||||||
navigatorObservers: () =>
|
navigatorObservers: () => [AppNavigationObserver(ref: ref), HeroController()],
|
||||||
[AppNavigationObserver(ref: ref), HeroController()],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -56,12 +56,7 @@ class Activity {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode {
|
int get hashCode {
|
||||||
return id.hashCode ^
|
return id.hashCode ^ assetId.hashCode ^ comment.hashCode ^ createdAt.hashCode ^ type.hashCode ^ user.hashCode;
|
||||||
assetId.hashCode ^
|
|
||||||
comment.hashCode ^
|
|
||||||
createdAt.hashCode ^
|
|
||||||
type.hashCode ^
|
|
||||||
user.hashCode;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,16 +32,14 @@ class AlbumAddAssetsResponse {
|
|||||||
String toJson() => json.encode(toMap());
|
String toJson() => json.encode(toMap());
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() =>
|
String toString() => 'AddAssetsResponse(alreadyInAlbum: $alreadyInAlbum, successfullyAdded: $successfullyAdded)';
|
||||||
'AddAssetsResponse(alreadyInAlbum: $alreadyInAlbum, successfullyAdded: $successfullyAdded)';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(covariant AlbumAddAssetsResponse other) {
|
bool operator ==(covariant AlbumAddAssetsResponse other) {
|
||||||
if (identical(this, other)) return true;
|
if (identical(this, other)) return true;
|
||||||
final listEquals = const DeepCollectionEquality().equals;
|
final listEquals = const DeepCollectionEquality().equals;
|
||||||
|
|
||||||
return listEquals(other.alreadyInAlbum, alreadyInAlbum) &&
|
return listEquals(other.alreadyInAlbum, alreadyInAlbum) && other.successfullyAdded == successfullyAdded;
|
||||||
other.successfullyAdded == successfullyAdded;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -43,8 +43,7 @@ class AlbumViewerPageState {
|
|||||||
|
|
||||||
String toJson() => json.encode(toMap());
|
String toJson() => json.encode(toMap());
|
||||||
|
|
||||||
factory AlbumViewerPageState.fromJson(String source) =>
|
factory AlbumViewerPageState.fromJson(String source) => AlbumViewerPageState.fromMap(json.decode(source));
|
||||||
AlbumViewerPageState.fromMap(json.decode(source));
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() =>
|
String toString() =>
|
||||||
@ -61,8 +60,5 @@ class AlbumViewerPageState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode =>
|
int get hashCode => isEditAlbum.hashCode ^ editTitleText.hashCode ^ editDescriptionText.hashCode;
|
||||||
isEditAlbum.hashCode ^
|
|
||||||
editTitleText.hashCode ^
|
|
||||||
editDescriptionText.hashCode;
|
|
||||||
}
|
}
|
||||||
|
@ -12,8 +12,7 @@ class AssetSelectionPageResult {
|
|||||||
if (identical(this, other)) return true;
|
if (identical(this, other)) return true;
|
||||||
final setEquals = const DeepCollectionEquality().equals;
|
final setEquals = const DeepCollectionEquality().equals;
|
||||||
|
|
||||||
return other is AssetSelectionPageResult &&
|
return other is AssetSelectionPageResult && setEquals(other.selectedAssets, selectedAssets);
|
||||||
setEquals(other.selectedAssets, selectedAssets);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -48,9 +48,5 @@ class AssetSelectionState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode =>
|
int get hashCode => hasRemote.hashCode ^ hasLocal.hashCode ^ hasMerged.hashCode ^ selectedCount.hashCode;
|
||||||
hasRemote.hashCode ^
|
|
||||||
hasLocal.hashCode ^
|
|
||||||
hasMerged.hashCode ^
|
|
||||||
selectedCount.hashCode;
|
|
||||||
}
|
}
|
||||||
|
@ -97,8 +97,7 @@ class AuxCheckStatus {
|
|||||||
|
|
||||||
String toJson() => json.encode(toMap());
|
String toJson() => json.encode(toMap());
|
||||||
|
|
||||||
factory AuxCheckStatus.fromJson(String source) =>
|
factory AuxCheckStatus.fromJson(String source) => AuxCheckStatus.fromMap(json.decode(source) as Map<String, dynamic>);
|
||||||
AuxCheckStatus.fromMap(json.decode(source) as Map<String, dynamic>);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() => 'AuxCheckStatus(name: $name)';
|
String toString() => 'AuxCheckStatus(name: $name)';
|
||||||
|
@ -11,8 +11,7 @@ class BiometricStatus {
|
|||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() =>
|
String toString() => 'BiometricStatus(availableBiometrics: $availableBiometrics, canAuthenticate: $canAuthenticate)';
|
||||||
'BiometricStatus(availableBiometrics: $availableBiometrics, canAuthenticate: $canAuthenticate)';
|
|
||||||
|
|
||||||
BiometricStatus copyWith({
|
BiometricStatus copyWith({
|
||||||
List<BiometricType>? availableBiometrics,
|
List<BiometricType>? availableBiometrics,
|
||||||
@ -29,8 +28,7 @@ class BiometricStatus {
|
|||||||
if (identical(this, other)) return true;
|
if (identical(this, other)) return true;
|
||||||
final listEquals = const DeepCollectionEquality().equals;
|
final listEquals = const DeepCollectionEquality().equals;
|
||||||
|
|
||||||
return listEquals(other.availableBiometrics, availableBiometrics) &&
|
return listEquals(other.availableBiometrics, availableBiometrics) && other.canAuthenticate == canAuthenticate;
|
||||||
other.canAuthenticate == canAuthenticate;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -29,8 +29,7 @@ class AvailableAlbum {
|
|||||||
bool get isAll => album.isAll;
|
bool get isAll => album.isAll;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() =>
|
String toString() => 'AvailableAlbum(albumEntity: $album, lastBackup: $lastBackup)';
|
||||||
'AvailableAlbum(albumEntity: $album, lastBackup: $lastBackup)';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
|
@ -8,13 +8,7 @@ import 'package:immich_mobile/models/backup/available_album.model.dart';
|
|||||||
import 'package:immich_mobile/models/backup/current_upload_asset.model.dart';
|
import 'package:immich_mobile/models/backup/current_upload_asset.model.dart';
|
||||||
import 'package:immich_mobile/models/server_info/server_disk_info.model.dart';
|
import 'package:immich_mobile/models/server_info/server_disk_info.model.dart';
|
||||||
|
|
||||||
enum BackUpProgressEnum {
|
enum BackUpProgressEnum { idle, inProgress, manualInProgress, inBackground, done }
|
||||||
idle,
|
|
||||||
inProgress,
|
|
||||||
manualInProgress,
|
|
||||||
inBackground,
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
class BackUpState {
|
class BackUpState {
|
||||||
// enum
|
// enum
|
||||||
@ -105,26 +99,21 @@ class BackUpState {
|
|||||||
progressInFileSize: progressInFileSize ?? this.progressInFileSize,
|
progressInFileSize: progressInFileSize ?? this.progressInFileSize,
|
||||||
progressInFileSpeed: progressInFileSpeed ?? this.progressInFileSpeed,
|
progressInFileSpeed: progressInFileSpeed ?? this.progressInFileSpeed,
|
||||||
progressInFileSpeeds: progressInFileSpeeds ?? this.progressInFileSpeeds,
|
progressInFileSpeeds: progressInFileSpeeds ?? this.progressInFileSpeeds,
|
||||||
progressInFileSpeedUpdateTime:
|
progressInFileSpeedUpdateTime: progressInFileSpeedUpdateTime ?? this.progressInFileSpeedUpdateTime,
|
||||||
progressInFileSpeedUpdateTime ?? this.progressInFileSpeedUpdateTime,
|
progressInFileSpeedUpdateSentBytes: progressInFileSpeedUpdateSentBytes ?? this.progressInFileSpeedUpdateSentBytes,
|
||||||
progressInFileSpeedUpdateSentBytes: progressInFileSpeedUpdateSentBytes ??
|
iCloudDownloadProgress: iCloudDownloadProgress ?? this.iCloudDownloadProgress,
|
||||||
this.progressInFileSpeedUpdateSentBytes,
|
|
||||||
iCloudDownloadProgress:
|
|
||||||
iCloudDownloadProgress ?? this.iCloudDownloadProgress,
|
|
||||||
cancelToken: cancelToken ?? this.cancelToken,
|
cancelToken: cancelToken ?? this.cancelToken,
|
||||||
serverInfo: serverInfo ?? this.serverInfo,
|
serverInfo: serverInfo ?? this.serverInfo,
|
||||||
autoBackup: autoBackup ?? this.autoBackup,
|
autoBackup: autoBackup ?? this.autoBackup,
|
||||||
backgroundBackup: backgroundBackup ?? this.backgroundBackup,
|
backgroundBackup: backgroundBackup ?? this.backgroundBackup,
|
||||||
backupRequireWifi: backupRequireWifi ?? this.backupRequireWifi,
|
backupRequireWifi: backupRequireWifi ?? this.backupRequireWifi,
|
||||||
backupRequireCharging:
|
backupRequireCharging: backupRequireCharging ?? this.backupRequireCharging,
|
||||||
backupRequireCharging ?? this.backupRequireCharging,
|
|
||||||
backupTriggerDelay: backupTriggerDelay ?? this.backupTriggerDelay,
|
backupTriggerDelay: backupTriggerDelay ?? this.backupTriggerDelay,
|
||||||
availableAlbums: availableAlbums ?? this.availableAlbums,
|
availableAlbums: availableAlbums ?? this.availableAlbums,
|
||||||
selectedBackupAlbums: selectedBackupAlbums ?? this.selectedBackupAlbums,
|
selectedBackupAlbums: selectedBackupAlbums ?? this.selectedBackupAlbums,
|
||||||
excludedBackupAlbums: excludedBackupAlbums ?? this.excludedBackupAlbums,
|
excludedBackupAlbums: excludedBackupAlbums ?? this.excludedBackupAlbums,
|
||||||
allUniqueAssets: allUniqueAssets ?? this.allUniqueAssets,
|
allUniqueAssets: allUniqueAssets ?? this.allUniqueAssets,
|
||||||
selectedAlbumsBackupAssetsIds:
|
selectedAlbumsBackupAssetsIds: selectedAlbumsBackupAssetsIds ?? this.selectedAlbumsBackupAssetsIds,
|
||||||
selectedAlbumsBackupAssetsIds ?? this.selectedAlbumsBackupAssetsIds,
|
|
||||||
currentUploadAsset: currentUploadAsset ?? this.currentUploadAsset,
|
currentUploadAsset: currentUploadAsset ?? this.currentUploadAsset,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -146,8 +135,7 @@ class BackUpState {
|
|||||||
other.progressInFileSpeed == progressInFileSpeed &&
|
other.progressInFileSpeed == progressInFileSpeed &&
|
||||||
collectionEquals(other.progressInFileSpeeds, progressInFileSpeeds) &&
|
collectionEquals(other.progressInFileSpeeds, progressInFileSpeeds) &&
|
||||||
other.progressInFileSpeedUpdateTime == progressInFileSpeedUpdateTime &&
|
other.progressInFileSpeedUpdateTime == progressInFileSpeedUpdateTime &&
|
||||||
other.progressInFileSpeedUpdateSentBytes ==
|
other.progressInFileSpeedUpdateSentBytes == progressInFileSpeedUpdateSentBytes &&
|
||||||
progressInFileSpeedUpdateSentBytes &&
|
|
||||||
other.iCloudDownloadProgress == iCloudDownloadProgress &&
|
other.iCloudDownloadProgress == iCloudDownloadProgress &&
|
||||||
other.cancelToken == cancelToken &&
|
other.cancelToken == cancelToken &&
|
||||||
other.serverInfo == serverInfo &&
|
other.serverInfo == serverInfo &&
|
||||||
|
@ -53,13 +53,11 @@ class CurrentUploadAsset {
|
|||||||
factory CurrentUploadAsset.fromMap(Map<String, dynamic> map) {
|
factory CurrentUploadAsset.fromMap(Map<String, dynamic> map) {
|
||||||
return CurrentUploadAsset(
|
return CurrentUploadAsset(
|
||||||
id: map['id'] as String,
|
id: map['id'] as String,
|
||||||
fileCreatedAt:
|
fileCreatedAt: DateTime.fromMillisecondsSinceEpoch(map['fileCreatedAt'] as int),
|
||||||
DateTime.fromMillisecondsSinceEpoch(map['fileCreatedAt'] as int),
|
|
||||||
fileName: map['fileName'] as String,
|
fileName: map['fileName'] as String,
|
||||||
fileType: map['fileType'] as String,
|
fileType: map['fileType'] as String,
|
||||||
fileSize: map['fileSize'] as int,
|
fileSize: map['fileSize'] as int,
|
||||||
iCloudAsset:
|
iCloudAsset: map['iCloudAsset'] != null ? map['iCloudAsset'] as bool : null,
|
||||||
map['iCloudAsset'] != null ? map['iCloudAsset'] as bool : null,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,17 +56,14 @@ class ManualUploadState {
|
|||||||
progressInFileSize: progressInFileSize ?? this.progressInFileSize,
|
progressInFileSize: progressInFileSize ?? this.progressInFileSize,
|
||||||
progressInFileSpeed: progressInFileSpeed ?? this.progressInFileSpeed,
|
progressInFileSpeed: progressInFileSpeed ?? this.progressInFileSpeed,
|
||||||
progressInFileSpeeds: progressInFileSpeeds ?? this.progressInFileSpeeds,
|
progressInFileSpeeds: progressInFileSpeeds ?? this.progressInFileSpeeds,
|
||||||
progressInFileSpeedUpdateTime:
|
progressInFileSpeedUpdateTime: progressInFileSpeedUpdateTime ?? this.progressInFileSpeedUpdateTime,
|
||||||
progressInFileSpeedUpdateTime ?? this.progressInFileSpeedUpdateTime,
|
progressInFileSpeedUpdateSentBytes: progressInFileSpeedUpdateSentBytes ?? this.progressInFileSpeedUpdateSentBytes,
|
||||||
progressInFileSpeedUpdateSentBytes: progressInFileSpeedUpdateSentBytes ??
|
|
||||||
this.progressInFileSpeedUpdateSentBytes,
|
|
||||||
cancelToken: cancelToken ?? this.cancelToken,
|
cancelToken: cancelToken ?? this.cancelToken,
|
||||||
currentUploadAsset: currentUploadAsset ?? this.currentUploadAsset,
|
currentUploadAsset: currentUploadAsset ?? this.currentUploadAsset,
|
||||||
totalAssetsToUpload: totalAssetsToUpload ?? this.totalAssetsToUpload,
|
totalAssetsToUpload: totalAssetsToUpload ?? this.totalAssetsToUpload,
|
||||||
currentAssetIndex: currentAssetIndex ?? this.currentAssetIndex,
|
currentAssetIndex: currentAssetIndex ?? this.currentAssetIndex,
|
||||||
successfulUploads: successfulUploads ?? this.successfulUploads,
|
successfulUploads: successfulUploads ?? this.successfulUploads,
|
||||||
showDetailedNotification:
|
showDetailedNotification: showDetailedNotification ?? this.showDetailedNotification,
|
||||||
showDetailedNotification ?? this.showDetailedNotification,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,8 +83,7 @@ class ManualUploadState {
|
|||||||
other.progressInFileSpeed == progressInFileSpeed &&
|
other.progressInFileSpeed == progressInFileSpeed &&
|
||||||
collectionEquals(other.progressInFileSpeeds, progressInFileSpeeds) &&
|
collectionEquals(other.progressInFileSpeeds, progressInFileSpeeds) &&
|
||||||
other.progressInFileSpeedUpdateTime == progressInFileSpeedUpdateTime &&
|
other.progressInFileSpeedUpdateTime == progressInFileSpeedUpdateTime &&
|
||||||
other.progressInFileSpeedUpdateSentBytes ==
|
other.progressInFileSpeedUpdateSentBytes == progressInFileSpeedUpdateSentBytes &&
|
||||||
progressInFileSpeedUpdateSentBytes &&
|
|
||||||
other.cancelToken == cancelToken &&
|
other.cancelToken == cancelToken &&
|
||||||
other.currentUploadAsset == currentUploadAsset &&
|
other.currentUploadAsset == currentUploadAsset &&
|
||||||
other.totalAssetsToUpload == totalAssetsToUpload &&
|
other.totalAssetsToUpload == totalAssetsToUpload &&
|
||||||
|
@ -31,12 +31,9 @@ class SuccessUploadAsset {
|
|||||||
bool operator ==(covariant SuccessUploadAsset other) {
|
bool operator ==(covariant SuccessUploadAsset other) {
|
||||||
if (identical(this, other)) return true;
|
if (identical(this, other)) return true;
|
||||||
|
|
||||||
return other.candidate == candidate &&
|
return other.candidate == candidate && other.remoteAssetId == remoteAssetId && other.isDuplicate == isDuplicate;
|
||||||
other.remoteAssetId == remoteAssetId &&
|
|
||||||
other.isDuplicate == isDuplicate;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode =>
|
int get hashCode => candidate.hashCode ^ remoteAssetId.hashCode ^ isDuplicate.hashCode;
|
||||||
candidate.hashCode ^ remoteAssetId.hashCode ^ isDuplicate.hashCode;
|
|
||||||
}
|
}
|
||||||
|
@ -59,8 +59,7 @@ class CastManagerState {
|
|||||||
|
|
||||||
String toJson() => json.encode(toMap());
|
String toJson() => json.encode(toMap());
|
||||||
|
|
||||||
factory CastManagerState.fromJson(String source) =>
|
factory CastManagerState.fromJson(String source) => CastManagerState.fromMap(json.decode(source));
|
||||||
CastManagerState.fromMap(json.decode(source));
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() =>
|
String toString() =>
|
||||||
@ -80,9 +79,5 @@ class CastManagerState {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode =>
|
int get hashCode =>
|
||||||
isCasting.hashCode ^
|
isCasting.hashCode ^ receiverName.hashCode ^ castState.hashCode ^ currentTime.hashCode ^ duration.hashCode;
|
||||||
receiverName.hashCode ^
|
|
||||||
castState.hashCode ^
|
|
||||||
currentTime.hashCode ^
|
|
||||||
duration.hashCode;
|
|
||||||
}
|
}
|
||||||
|
@ -46,20 +46,16 @@ class DownloadInfo {
|
|||||||
|
|
||||||
String toJson() => json.encode(toMap());
|
String toJson() => json.encode(toMap());
|
||||||
|
|
||||||
factory DownloadInfo.fromJson(String source) =>
|
factory DownloadInfo.fromJson(String source) => DownloadInfo.fromMap(json.decode(source) as Map<String, dynamic>);
|
||||||
DownloadInfo.fromMap(json.decode(source) as Map<String, dynamic>);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() =>
|
String toString() => 'DownloadInfo(fileName: $fileName, progress: $progress, status: $status)';
|
||||||
'DownloadInfo(fileName: $fileName, progress: $progress, status: $status)';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(covariant DownloadInfo other) {
|
bool operator ==(covariant DownloadInfo other) {
|
||||||
if (identical(this, other)) return true;
|
if (identical(this, other)) return true;
|
||||||
|
|
||||||
return other.fileName == fileName &&
|
return other.fileName == fileName && other.progress == progress && other.status == status;
|
||||||
other.progress == progress &&
|
|
||||||
other.status == status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -104,6 +100,5 @@ class DownloadState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode =>
|
int get hashCode => downloadStatus.hashCode ^ taskProgress.hashCode ^ showProgress.hashCode;
|
||||||
downloadStatus.hashCode ^ taskProgress.hashCode ^ showProgress.hashCode;
|
|
||||||
}
|
}
|
||||||
|
@ -24,8 +24,7 @@ class MapMarker {
|
|||||||
assetRemoteId = dto.id;
|
assetRemoteId = dto.id;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() =>
|
String toString() => 'MapMarker(latLng: $latLng, assetRemoteId: $assetRemoteId)';
|
||||||
'MapMarker(latLng: $latLng, assetRemoteId: $assetRemoteId)';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(covariant MapMarker other) {
|
bool operator ==(covariant MapMarker other) {
|
||||||
|
@ -30,9 +30,7 @@ class Memory {
|
|||||||
if (identical(this, other)) return true;
|
if (identical(this, other)) return true;
|
||||||
final listEquals = const DeepCollectionEquality().equals;
|
final listEquals = const DeepCollectionEquality().equals;
|
||||||
|
|
||||||
return other is Memory &&
|
return other is Memory && other.title == title && listEquals(other.assets, assets);
|
||||||
other.title == title &&
|
|
||||||
listEquals(other.assets, assets);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -54,8 +54,7 @@ class SearchCuratedContent {
|
|||||||
SearchCuratedContent.fromMap(json.decode(source) as Map<String, dynamic>);
|
SearchCuratedContent.fromMap(json.decode(source) as Map<String, dynamic>);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() =>
|
String toString() => 'CuratedContent(label: $label, subtitle: $subtitle, id: $id)';
|
||||||
'CuratedContent(label: $label, subtitle: $subtitle, id: $id)';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(covariant SearchCuratedContent other) {
|
bool operator ==(covariant SearchCuratedContent other) {
|
||||||
|
@ -48,16 +48,13 @@ class SearchLocationFilter {
|
|||||||
SearchLocationFilter.fromMap(json.decode(source) as Map<String, dynamic>);
|
SearchLocationFilter.fromMap(json.decode(source) as Map<String, dynamic>);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() =>
|
String toString() => 'SearchLocationFilter(country: $country, state: $state, city: $city)';
|
||||||
'SearchLocationFilter(country: $country, state: $state, city: $city)';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(covariant SearchLocationFilter other) {
|
bool operator ==(covariant SearchLocationFilter other) {
|
||||||
if (identical(this, other)) return true;
|
if (identical(this, other)) return true;
|
||||||
|
|
||||||
return other.country == country &&
|
return other.country == country && other.state == state && other.city == city;
|
||||||
other.state == state &&
|
|
||||||
other.city == city;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -142,12 +139,8 @@ class SearchDateFilter {
|
|||||||
|
|
||||||
factory SearchDateFilter.fromMap(Map<String, dynamic> map) {
|
factory SearchDateFilter.fromMap(Map<String, dynamic> map) {
|
||||||
return SearchDateFilter(
|
return SearchDateFilter(
|
||||||
takenBefore: map['takenBefore'] != null
|
takenBefore: map['takenBefore'] != null ? DateTime.fromMillisecondsSinceEpoch(map['takenBefore'] as int) : null,
|
||||||
? DateTime.fromMillisecondsSinceEpoch(map['takenBefore'] as int)
|
takenAfter: map['takenAfter'] != null ? DateTime.fromMillisecondsSinceEpoch(map['takenAfter'] as int) : null,
|
||||||
: null,
|
|
||||||
takenAfter: map['takenAfter'] != null
|
|
||||||
? DateTime.fromMillisecondsSinceEpoch(map['takenAfter'] as int)
|
|
||||||
: null,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,8 +150,7 @@ class SearchDateFilter {
|
|||||||
SearchDateFilter.fromMap(json.decode(source) as Map<String, dynamic>);
|
SearchDateFilter.fromMap(json.decode(source) as Map<String, dynamic>);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() =>
|
String toString() => 'SearchDateFilter(takenBefore: $takenBefore, takenAfter: $takenAfter)';
|
||||||
'SearchDateFilter(takenBefore: $takenBefore, takenAfter: $takenAfter)';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(covariant SearchDateFilter other) {
|
bool operator ==(covariant SearchDateFilter other) {
|
||||||
@ -222,14 +214,11 @@ class SearchDisplayFilters {
|
|||||||
bool operator ==(covariant SearchDisplayFilters other) {
|
bool operator ==(covariant SearchDisplayFilters other) {
|
||||||
if (identical(this, other)) return true;
|
if (identical(this, other)) return true;
|
||||||
|
|
||||||
return other.isNotInAlbum == isNotInAlbum &&
|
return other.isNotInAlbum == isNotInAlbum && other.isArchive == isArchive && other.isFavorite == isFavorite;
|
||||||
other.isArchive == isArchive &&
|
|
||||||
other.isFavorite == isFavorite;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode =>
|
int get hashCode => isNotInAlbum.hashCode ^ isArchive.hashCode ^ isFavorite.hashCode;
|
||||||
isNotInAlbum.hashCode ^ isArchive.hashCode ^ isFavorite.hashCode;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class SearchFilter {
|
class SearchFilter {
|
||||||
|
@ -52,10 +52,6 @@ class SearchResultPageState {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode {
|
int get hashCode {
|
||||||
return isLoading.hashCode ^
|
return isLoading.hashCode ^ isSuccess.hashCode ^ isError.hashCode ^ isSmart.hashCode ^ searchResult.hashCode;
|
||||||
isSuccess.hashCode ^
|
|
||||||
isError.hashCode ^
|
|
||||||
isSmart.hashCode ^
|
|
||||||
searchResult.hashCode;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,6 +50,5 @@ class ServerConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode =>
|
int get hashCode => trashDays.hashCode ^ oauthButtonText.hashCode ^ externalDomain.hashCode;
|
||||||
trashDays.hashCode ^ oauthButtonText.hashCode ^ externalDomain.hashCode;
|
|
||||||
}
|
}
|
||||||
|
@ -51,9 +51,6 @@ class ServerDiskInfo {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode {
|
int get hashCode {
|
||||||
return diskAvailable.hashCode ^
|
return diskAvailable.hashCode ^ diskSize.hashCode ^ diskUse.hashCode ^ diskUsagePercentage.hashCode;
|
||||||
diskSize.hashCode ^
|
|
||||||
diskUse.hashCode ^
|
|
||||||
diskUsagePercentage.hashCode;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,9 +50,6 @@ class ServerFeatures {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode {
|
int get hashCode {
|
||||||
return trash.hashCode ^
|
return trash.hashCode ^ map.hashCode ^ oauthEnabled.hashCode ^ passwordLogin.hashCode;
|
||||||
map.hashCode ^
|
|
||||||
oauthEnabled.hashCode ^
|
|
||||||
passwordLogin.hashCode;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,10 +41,8 @@ class ServerInfo {
|
|||||||
serverConfig: serverConfig ?? this.serverConfig,
|
serverConfig: serverConfig ?? this.serverConfig,
|
||||||
serverDiskInfo: serverDiskInfo ?? this.serverDiskInfo,
|
serverDiskInfo: serverDiskInfo ?? this.serverDiskInfo,
|
||||||
isVersionMismatch: isVersionMismatch ?? this.isVersionMismatch,
|
isVersionMismatch: isVersionMismatch ?? this.isVersionMismatch,
|
||||||
isNewReleaseAvailable:
|
isNewReleaseAvailable: isNewReleaseAvailable ?? this.isNewReleaseAvailable,
|
||||||
isNewReleaseAvailable ?? this.isNewReleaseAvailable,
|
versionMismatchErrorMessage: versionMismatchErrorMessage ?? this.versionMismatchErrorMessage,
|
||||||
versionMismatchErrorMessage:
|
|
||||||
versionMismatchErrorMessage ?? this.versionMismatchErrorMessage,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,10 +37,7 @@ class ServerVersion {
|
|||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
if (identical(this, other)) return true;
|
if (identical(this, other)) return true;
|
||||||
|
|
||||||
return other is ServerVersion &&
|
return other is ServerVersion && other.major == major && other.minor == minor && other.patch == patch;
|
||||||
other.major == major &&
|
|
||||||
other.minor == minor &&
|
|
||||||
other.patch == patch;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -66,9 +66,7 @@ class SharedLink {
|
|||||||
expiresAt = dto.expiresAt,
|
expiresAt = dto.expiresAt,
|
||||||
key = dto.key,
|
key = dto.key,
|
||||||
showMetadata = dto.showMetadata,
|
showMetadata = dto.showMetadata,
|
||||||
type = dto.type == SharedLinkType.ALBUM
|
type = dto.type == SharedLinkType.ALBUM ? SharedLinkSource.album : SharedLinkSource.individual,
|
||||||
? SharedLinkSource.album
|
|
||||||
: SharedLinkSource.individual,
|
|
||||||
title = dto.type == SharedLinkType.ALBUM
|
title = dto.type == SharedLinkType.ALBUM
|
||||||
? dto.album?.albumName.toUpperCase() ?? "UNKNOWN SHARE"
|
? dto.album?.albumName.toUpperCase() ?? "UNKNOWN SHARE"
|
||||||
: "INDIVIDUAL SHARE",
|
: "INDIVIDUAL SHARE",
|
||||||
|
@ -90,8 +90,7 @@ class ShareIntentAttachment {
|
|||||||
|
|
||||||
String toJson() => json.encode(toMap());
|
String toJson() => json.encode(toMap());
|
||||||
|
|
||||||
factory ShareIntentAttachment.fromJson(String source) =>
|
factory ShareIntentAttachment.fromJson(String source) => ShareIntentAttachment.fromMap(
|
||||||
ShareIntentAttachment.fromMap(
|
|
||||||
json.decode(source) as Map<String, dynamic>,
|
json.decode(source) as Map<String, dynamic>,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -21,8 +21,7 @@ class AlbumAdditionalSharedUserSelectionPage extends HookConsumerWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
final AsyncValue<List<UserDto>> suggestedShareUsers =
|
final AsyncValue<List<UserDto>> suggestedShareUsers = ref.watch(otherUsersProvider);
|
||||||
ref.watch(otherUsersProvider);
|
|
||||||
final sharedUsersList = useState<Set<UserDto>>({});
|
final sharedUsersList = useState<Set<UserDto>>({});
|
||||||
|
|
||||||
addNewUsersHandler() {
|
addNewUsersHandler() {
|
||||||
@ -138,8 +137,7 @@ class AlbumAdditionalSharedUserSelectionPage extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed:
|
onPressed: sharedUsersList.value.isEmpty ? null : addNewUsersHandler,
|
||||||
sharedUsersList.value.isEmpty ? null : addNewUsersHandler,
|
|
||||||
child: const Text(
|
child: const Text(
|
||||||
"add",
|
"add",
|
||||||
style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold),
|
style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold),
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user