High performance self-hosted photo and video management solution.
TypeScript backup-toolfluttergoogle-photosgoogle-photos-alternativejavascriptmobile-appnestjsnodejsphoto-galleryphotosphotos-managementself-hostedsveltesveltekittypescriptvideos
fix(server): `getTimeBuckets` not handling boolean filters correctly (#15567)
Mert071b27148478
diff --git a/server/src/repositories/asset.repository.ts b/server/src/repositories/asset.repository.tsindex a53b1dbd92..00fa130bb4 100644--- a/server/src/repositories/asset.repository.ts+++ b/server/src/repositories/asset.repository.ts@@ -605,10 +605,10 @@ export class AssetRepository implements IAssetRepository {.where((eb) => eb.or([eb('assets.stackId', 'is', null), eb(eb.table('asset_stack'), 'is not', null)])),).$if(!!options.userIds, (qb) => qb.where('assets.ownerId', '=', anyUuid(options.userIds!)))- .$if(!!options.isArchived, (qb) => qb.where('assets.isArchived', '=', options.isArchived!))- .$if(!!options.isFavorite, (qb) => qb.where('assets.isFavorite', '=', options.isFavorite!))+ .$if(options.isArchived !== undefined, (qb) => qb.where('assets.isArchived', '=', options.isArchived!))+ .$if(options.isFavorite !== undefined, (qb) => qb.where('assets.isFavorite', '=', options.isFavorite!)).$if(!!options.assetType, (qb) => qb.where('assets.type', '=', options.assetType!))- .$if(!!options.isDuplicate, (qb) =>+ .$if(options.isDuplicate !== undefined, (qb) =>qb.where('assets.duplicateId', options.isDuplicate ? 'is not' : 'is', null),).$if(!!options.tagId, (qb) => withTagId(qb, options.tagId!)),@@ -622,7 +622,7 @@ export class AssetRepository implements IAssetRepository {*/.select((eb) => eb.fn.countAll().as('count')).groupBy('timeBucket')- .orderBy('timeBucket', 'desc')+ .orderBy('timeBucket', options.order ?? 'desc').execute() as any as Promise<TimeBucketItem[]>);}@@ -666,7 +666,7 @@ export class AssetRepository implements IAssetRepository {.where('assets.deletedAt', options.isTrashed ? 'is not' : 'is', null).where('assets.isVisible', '=', true).where(truncatedDate(options.size), '=', timeBucket.replace(/^[+-]/, ''))- .orderBy('assets.localDateTime', 'desc')+ .orderBy('assets.localDateTime', options.order ?? 'desc').execute() as any as Promise<AssetEntity[]>;}