mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
fix: ifPresent
This commit is contained in:
@@ -31,11 +31,11 @@ class DriftMapRepository extends DriftDatabaseRepository {
|
|||||||
final hasCustomRange = timeRange.from.isSome || timeRange.to.isSome;
|
final hasCustomRange = timeRange.from.isSome || timeRange.to.isSome;
|
||||||
|
|
||||||
if (hasCustomRange) {
|
if (hasCustomRange) {
|
||||||
timeRange.from.ifSome((from) {
|
timeRange.from.ifPresent((from) {
|
||||||
condition = condition & _db.remoteAssetEntity.createdAt.isBiggerOrEqualValue(from);
|
condition = condition & _db.remoteAssetEntity.createdAt.isBiggerOrEqualValue(from);
|
||||||
});
|
});
|
||||||
|
|
||||||
timeRange.to.ifSome((to) {
|
timeRange.to.ifPresent((to) {
|
||||||
condition = condition & _db.remoteAssetEntity.createdAt.isSmallerOrEqualValue(to);
|
condition = condition & _db.remoteAssetEntity.createdAt.isSmallerOrEqualValue(to);
|
||||||
});
|
});
|
||||||
} else if (options.relativeDays > 0) {
|
} else if (options.relativeDays > 0) {
|
||||||
|
|||||||
@@ -557,11 +557,11 @@ class DriftTimelineRepository extends DriftDatabaseRepository {
|
|||||||
final hasCustomRange = timeRange.from.isSome || timeRange.to.isSome;
|
final hasCustomRange = timeRange.from.isSome || timeRange.to.isSome;
|
||||||
|
|
||||||
if (hasCustomRange) {
|
if (hasCustomRange) {
|
||||||
timeRange.from.ifSome((from) {
|
timeRange.from.ifPresent((from) {
|
||||||
query.where(_db.remoteAssetEntity.createdAt.isBiggerOrEqualValue(from));
|
query.where(_db.remoteAssetEntity.createdAt.isBiggerOrEqualValue(from));
|
||||||
});
|
});
|
||||||
|
|
||||||
timeRange.to.ifSome((to) {
|
timeRange.to.ifPresent((to) {
|
||||||
query.where(_db.remoteAssetEntity.createdAt.isSmallerOrEqualValue(to));
|
query.where(_db.remoteAssetEntity.createdAt.isSmallerOrEqualValue(to));
|
||||||
});
|
});
|
||||||
} else if (options.relativeDays > 0) {
|
} else if (options.relativeDays > 0) {
|
||||||
@@ -612,11 +612,11 @@ class DriftTimelineRepository extends DriftDatabaseRepository {
|
|||||||
final hasCustomRange = timeRange.from.isSome || timeRange.to.isSome;
|
final hasCustomRange = timeRange.from.isSome || timeRange.to.isSome;
|
||||||
|
|
||||||
if (hasCustomRange) {
|
if (hasCustomRange) {
|
||||||
timeRange.from.ifSome((from) {
|
timeRange.from.ifPresent((from) {
|
||||||
query.where(_db.remoteAssetEntity.createdAt.isBiggerOrEqualValue(from));
|
query.where(_db.remoteAssetEntity.createdAt.isBiggerOrEqualValue(from));
|
||||||
});
|
});
|
||||||
|
|
||||||
timeRange.to.ifSome((to) {
|
timeRange.to.ifPresent((to) {
|
||||||
query.where(_db.remoteAssetEntity.createdAt.isSmallerOrEqualValue(to));
|
query.where(_db.remoteAssetEntity.createdAt.isSmallerOrEqualValue(to));
|
||||||
});
|
});
|
||||||
} else if (options.relativeDays > 0) {
|
} else if (options.relativeDays > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user