mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-28 19:06:19 -05:00
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:
parent
2b8ef79561
commit
45167e4f32
39 changed files with 691 additions and 165 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue