1
0
mirror of https://github.com/immich-app/immich.git synced 2025-07-03 05:46:58 +02:00

feat(server): add /search/statistics resource (#18885)

This commit is contained in:
Jonathan Gilbert
2025-06-07 11:12:53 +10:00
committed by GitHub
parent ecb16d9907
commit fb4be6e231
14 changed files with 954 additions and 16 deletions

View File

@ -995,6 +995,38 @@ export type SmartSearchDto = {
withDeleted?: boolean;
withExif?: boolean;
};
export type StatisticsSearchDto = {
city?: string | null;
country?: string | null;
createdAfter?: string;
createdBefore?: string;
description?: string;
deviceId?: string;
isEncoded?: boolean;
isFavorite?: boolean;
isMotion?: boolean;
isNotInAlbum?: boolean;
isOffline?: boolean;
lensModel?: string | null;
libraryId?: string | null;
make?: string;
model?: string | null;
personIds?: string[];
rating?: number;
state?: string | null;
tagIds?: string[];
takenAfter?: string;
takenBefore?: string;
trashedAfter?: string;
trashedBefore?: string;
"type"?: AssetTypeEnum;
updatedAfter?: string;
updatedBefore?: string;
visibility?: AssetVisibility;
};
export type SearchStatisticsResponseDto = {
total: number;
};
export type ServerAboutResponseDto = {
build?: string;
buildImage?: string;
@ -2882,6 +2914,18 @@ export function searchSmart({ smartSearchDto }: {
body: smartSearchDto
})));
}
export function searchAssetStatistics({ statisticsSearchDto }: {
statisticsSearchDto: StatisticsSearchDto;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: SearchStatisticsResponseDto;
}>("/search/statistics", oazapfts.json({
...opts,
method: "POST",
body: statisticsSearchDto
})));
}
export function getSearchSuggestions({ country, includeNull, make, model, state, $type }: {
country?: string;
includeNull?: boolean;