fix(server): external library sync not working for large libraries (#7759)

This commit is contained in:
Mert
2024-03-10 22:30:57 -04:00
committed by GitHub
parent 49d9051879
commit 5bd597f14b
9 changed files with 106 additions and 104 deletions
@@ -2,6 +2,7 @@ import {
AssetBuilderOptions,
AssetCreate,
AssetExploreFieldOptions,
AssetPathEntity,
AssetSearchOptions,
AssetStats,
AssetStatsOptions,
@@ -184,10 +185,10 @@ export class AssetRepository implements IAssetRepository {
}
@GenerateSql({ params: [[DummyValue.UUID]] })
@ChunkedArray()
getByLibraryId(libraryIds: string[]): Promise<AssetEntity[]> {
return this.repository.find({
where: { library: { id: In(libraryIds) } },
getLibraryAssetPaths(pagination: PaginationOptions, libraryId: string): Paginated<AssetPathEntity> {
return paginate(this.repository, pagination, {
select: { id: true, originalPath: true, isOffline: true },
where: { library: { id: libraryId } },
});
}