fix(server): better facial recognition order (#3386)
This commit is contained in:
parent
b83e535010
commit
e493e05e99
3 changed files with 3 additions and 2 deletions
|
@ -11,6 +11,7 @@ export interface AssetStatsOptions {
|
||||||
export interface AssetSearchOptions {
|
export interface AssetSearchOptions {
|
||||||
isVisible?: boolean;
|
isVisible?: boolean;
|
||||||
type?: AssetType;
|
type?: AssetType;
|
||||||
|
order?: 'ASC' | 'DESC';
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface LivePhotoSearchOptions {
|
export interface LivePhotoSearchOptions {
|
||||||
|
|
|
@ -29,7 +29,7 @@ export class FacialRecognitionService {
|
||||||
async handleQueueRecognizeFaces({ force }: IBaseJob) {
|
async handleQueueRecognizeFaces({ force }: IBaseJob) {
|
||||||
const assetPagination = usePagination(JOBS_ASSET_PAGINATION_SIZE, (pagination) => {
|
const assetPagination = usePagination(JOBS_ASSET_PAGINATION_SIZE, (pagination) => {
|
||||||
return force
|
return force
|
||||||
? this.assetRepository.getAll(pagination)
|
? this.assetRepository.getAll(pagination, { order: 'DESC' })
|
||||||
: this.assetRepository.getWithout(pagination, WithoutProperty.FACES);
|
: this.assetRepository.getWithout(pagination, WithoutProperty.FACES);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,7 @@ export class AssetRepository implements IAssetRepository {
|
||||||
},
|
},
|
||||||
order: {
|
order: {
|
||||||
// Ensures correct order when paginating
|
// Ensures correct order when paginating
|
||||||
createdAt: 'ASC',
|
createdAt: options.order ?? 'ASC',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue