feat(library): add strategy parameter for item fetching and update filter preview
This commit is contained in:
@@ -129,6 +129,7 @@ export const api = {
|
||||
token: string,
|
||||
filter: Pick<MediaFilter, "content_type" | "series_names" | "collections" | "search_term" | "genres">,
|
||||
limit = 50,
|
||||
strategy?: string,
|
||||
) => {
|
||||
const params = new URLSearchParams();
|
||||
if (filter.search_term) params.set("q", filter.search_term);
|
||||
@@ -136,6 +137,7 @@ export const api = {
|
||||
filter.series_names?.forEach((name) => params.append("series[]", name));
|
||||
if (filter.collections?.[0]) params.set("collection", filter.collections[0]);
|
||||
params.set("limit", String(limit));
|
||||
if (strategy) params.set("strategy", strategy);
|
||||
return request<LibraryItemResponse[]>(`/library/items?${params}`, { token });
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user