A Channel can be tagged with a single Tag. The Channel can be moved into a Tag Directory according to the config.

This commit is contained in:
Roland 2024-08-06 18:13:21 -06:00
parent 2b8ef79561
commit 45167e4f32
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
39 changed files with 691 additions and 165 deletions

View file

@ -112,6 +112,32 @@ export async function getChannel(id) {
return (await response.json())['channel'];
}
export async function tagChannel(channelId, tagName, directory) {
const body = {
tag_name: tagName,
}
if (directory) {
body['directory'] = directory;
}
const response = await apiPost(`${VIDEOS_API}/channels/${channelId}/tag`, body);
if (!response.ok) {
toast({
type: 'error',
title: 'Unexpected server response',
description: 'Failed to tag channel. See server logs.',
time: 5000,
});
}
}
export async function tagChannelInfo(channelId, tagName) {
const body = {tag_name: tagName}
const response = await apiPost(`${VIDEOS_API}/channels/${channelId}/tag_info`, body);
if (response.ok) {
return (await response.json()).videos_destination;
}
}
export async function searchVideos(offset, limit, channelId, searchStr, order_by, tagNames, headline) {
// Build a search query to retrieve a list of videos from the API
offset = parseInt(offset || 0);