mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-21 07:26:18 -05:00
Other search tab: search Channels by name, add Domains and Playlists, fix the estimate (#785)
* Count Channels with any of the Tags in the Other search estimate The Other tab lists Channels with any of the selected Tags, but its estimate only counted Channels with the first Tag, so the two disagreed when several Tags were selected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Search Channels by name in the Other search tab The Other tab only listed Channels with the selected Tags, so typing a Channel's name found nothing. Channels now match the search text by name, and the Tags when there are both. The list and its estimate share one query. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Add Domains to the Other search tab Domains match the search text by name and/or any of the Tags, like Channels. The list and its estimate share one query. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Add Playlists to the Other search tab Domains and Playlists are Collections, so the Other tab searches both with the existing /api/collections/search (by kind) instead of a Domain-only endpoint. The search and the estimate share search_collections_query. The search now loads each Collection's Downloads up front instead of once per Collection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
93d878952c
commit
a1292005ce
14 changed files with 309 additions and 73 deletions
|
|
@ -2118,8 +2118,8 @@ export async function searchEstimateOthers(tagNames, searchStr) {
|
|||
}
|
||||
}
|
||||
|
||||
export async function searchChannels(tagNames) {
|
||||
const body = {tag_names: tagNames};
|
||||
export async function searchChannels(tagNames, searchStr) {
|
||||
const body = {tag_names: tagNames, search_str: searchStr};
|
||||
const response = await apiPost(`${API_URI}/videos/channels/search`, body);
|
||||
if (response.ok) {
|
||||
const content = await response.json();
|
||||
|
|
@ -2129,6 +2129,16 @@ export async function searchChannels(tagNames) {
|
|||
}
|
||||
}
|
||||
|
||||
// Collections of `kind` whose name matches `searchStr` and/or which have any of the tags.
|
||||
export async function searchCollections(kind, tagNames, searchStr) {
|
||||
const body = {kind, tag_names: tagNames, search_str: searchStr};
|
||||
const response = await apiPost(`${COLLECTIONS_API}/search`, body);
|
||||
if (response.ok) {
|
||||
const content = await response.json();
|
||||
return {collections: content.collections};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getOutdatedZims() {
|
||||
const response = await apiGet(`${API_URI}/zim/outdated`);
|
||||
if (response.status === 200) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue