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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 967 additions and 11 deletions

View file

@ -6,6 +6,7 @@ import { PersonResponseDto } from 'src/dtos/person.dto';
import {
MetadataSearchDto,
PlacesResponseDto,
RandomSearchDto,
SearchExploreResponseDto,
SearchPeopleDto,
SearchPlacesDto,
@ -28,6 +29,13 @@ export class SearchController {
return this.service.searchMetadata(auth, dto);
}
@Post('random')
@HttpCode(HttpStatus.OK)
@Authenticated()
searchRandom(@Auth() auth: AuthDto, @Body() dto: RandomSearchDto): Promise<SearchResponseDto> {
return this.service.searchRandom(auth, dto);
}
@Post('smart')
@HttpCode(HttpStatus.OK)
@Authenticated()