High performance self-hosted photo and video management solution.
TypeScript backup-toolfluttergoogle-photosgoogle-photos-alternativejavascriptmobile-appnestjsnodejsphoto-galleryphotosphotos-managementself-hostedsveltesveltekittypescriptvideos
fix(server): don't sync null date assets (#17247)
Jonathan Jogenforsefcb1129ceb1
diff --git a/server/src/queries/asset.repository.sql b/server/src/queries/asset.repository.sqlindex e812b33f78..b2fdf976df 100644--- a/server/src/queries/asset.repository.sql+++ b/server/src/queries/asset.repository.sql@@ -426,6 +426,9 @@ fromwhere"assets"."ownerId" = $1::uuidand "assets"."isVisible" = $2+ and "assets"."fileCreatedAt" is not null+ and "assets"."fileModifiedAt" is not null+ and "assets"."localDateTime" is not nulland "assets"."updatedAt" <= $3and "assets"."id" > $4order by@@ -456,6 +459,9 @@ fromwhere"assets"."ownerId" = any ($1::uuid[])and "assets"."isVisible" = $2+ and "assets"."fileCreatedAt" is not null+ and "assets"."fileModifiedAt" is not null+ and "assets"."localDateTime" is not nulland "assets"."updatedAt" > $3limit$4diff --git a/server/src/repositories/asset.repository.ts b/server/src/repositories/asset.repository.tsindex 35a5ab21a9..e2e1bd9a6f 100644--- a/server/src/repositories/asset.repository.ts+++ b/server/src/repositories/asset.repository.ts@@ -967,6 +967,9 @@ export class AssetRepository {.select((eb) => eb.fn.toJson(eb.table('stacked_assets')).as('stack')).where('assets.ownerId', '=', asUuid(ownerId)).where('assets.isVisible', '=', true)+ .where('assets.fileCreatedAt', 'is not', null)+ .where('assets.fileModifiedAt', 'is not', null)+ .where('assets.localDateTime', 'is not', null).where('assets.updatedAt', '<=', updatedUntil).$if(!!lastId, (qb) => qb.where('assets.id', '>', lastId!)).orderBy('assets.id')@@ -995,6 +998,9 @@ export class AssetRepository {.select((eb) => eb.fn.toJson(eb.table('stacked_assets')).as('stack')).where('assets.ownerId', '=', anyUuid(options.userIds)).where('assets.isVisible', '=', true)+ .where('assets.fileCreatedAt', 'is not', null)+ .where('assets.fileModifiedAt', 'is not', null)+ .where('assets.localDateTime', 'is not', null).where('assets.updatedAt', '>', options.updatedAfter).limit(options.limit).execute() as any as Promise<AssetEntity[]>;