fix(server): include partner assets in random endpoint (#12599)

This commit is contained in:
Jason Rasmussen
2024-09-12 13:56:38 -04:00
committed by GitHub
parent d03e97f650
commit 7b737786b3
3 changed files with 10 additions and 10 deletions

View File

@@ -623,14 +623,9 @@ export class AssetRepository implements IAssetRepository {
return result;
}
@GenerateSql({ params: [DummyValue.UUID, DummyValue.NUMBER] })
getRandom(ownerId: string, count: number): Promise<AssetEntity[]> {
const builder = this.getBuilder({
userIds: [ownerId],
exifInfo: true,
});
return builder.orderBy('RANDOM()').limit(count).getMany();
@GenerateSql({ params: [[DummyValue.UUID], DummyValue.NUMBER] })
getRandom(userIds: string[], count: number): Promise<AssetEntity[]> {
return this.getBuilder({ userIds, exifInfo: true }).orderBy('RANDOM()').limit(count).getMany();
}
@GenerateSql({ params: [{ size: TimeBucketSize.MONTH }] })