feat(server): sort assets randomly from the API 'api/search/metadata' endpoint by including 'order': 'rand' in the API call. (#12741)

feat(server): search metadata random sort order

Co-authored-by: Jason Rasmussen <jason@rasm.me>
This commit is contained in:
jschwalbe
2024-09-23 12:09:26 -04:00
committed by GitHub
parent a7719a94fc
commit 9f8a7e0bea
15 changed files with 967 additions and 11 deletions

View File

@@ -119,7 +119,15 @@ class BaseSearchDto {
personIds?: string[];
}
export class MetadataSearchDto extends BaseSearchDto {
export class RandomSearchDto extends BaseSearchDto {
@ValidateBoolean({ optional: true })
withStacked?: boolean;
@ValidateBoolean({ optional: true })
withPeople?: boolean;
}
export class MetadataSearchDto extends RandomSearchDto {
@ValidateUUID({ optional: true })
id?: string;
@@ -133,12 +141,6 @@ export class MetadataSearchDto extends BaseSearchDto {
@Optional()
checksum?: string;
@ValidateBoolean({ optional: true })
withStacked?: boolean;
@ValidateBoolean({ optional: true })
withPeople?: boolean;
@IsString()
@IsNotEmpty()
@Optional()