mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-20 15:06:19 -05:00
Feature/censored videos (#65)
* Creating api endpoint to find censored videos. * Videos can be filtered by censored status. * Not deleting when there has not been a successful download. * Search now has a different param order. * Displaying correct header for videos page. * Reworking FilterModal to be more universal. * Using merge_output_format for preparing filename. * Resetting attempts when user requests a download be started. * Displaying video stem as title if no title is available. Signed-off-by: Roland <roland@learningselfreliance.com>
This commit is contained in:
parent
ea2bf8530b
commit
02116bf2bc
15 changed files with 451 additions and 121 deletions
|
|
@ -36,7 +36,7 @@ async function apiCall(url, method, body, ms = 10000) {
|
|||
if (response.status === 403 && (await response.json())['code'] === 17) {
|
||||
toast({
|
||||
type: 'error',
|
||||
title: 'WROL Mode is enabled!',
|
||||
header: 'WROL Mode is enabled!',
|
||||
description: 'This functionality is not enabled while WROL Mode is enabled!',
|
||||
time: 5000,
|
||||
});
|
||||
|
|
@ -47,14 +47,14 @@ async function apiCall(url, method, body, ms = 10000) {
|
|||
if (e.message === 'promise timeout') {
|
||||
toast({
|
||||
type: 'error',
|
||||
title: 'Server failed to respond!',
|
||||
header: 'Server failed to respond!',
|
||||
description: 'Timeout while waiting for server response. See server logs.',
|
||||
time: 5000,
|
||||
});
|
||||
} else {
|
||||
toast({
|
||||
type: 'error',
|
||||
title: 'Error!',
|
||||
header: 'Error!',
|
||||
description: 'See client logs',
|
||||
time: 5000,
|
||||
});
|
||||
|
|
@ -103,11 +103,11 @@ export async function getChannel(link) {
|
|||
return (await response.json())['channel'];
|
||||
}
|
||||
|
||||
export async function searchVideos(offset, limit, channel_link, searchStr, favorites, order_by) {
|
||||
export async function searchVideos(offset, limit, channel_link, searchStr, order_by, filters) {
|
||||
// Build a search query to retrieve a list of videos from the API
|
||||
offset = offset || 0;
|
||||
limit = limit || DEFAULT_LIMIT;
|
||||
let body = {offset, limit, favorites: favorites};
|
||||
let body = {offset, limit, filters};
|
||||
|
||||
if (searchStr) {
|
||||
body.search_str = searchStr;
|
||||
|
|
@ -138,7 +138,7 @@ export async function deleteVideo(video_id) {
|
|||
if (data.code === 17) {
|
||||
toast({
|
||||
type: 'warning',
|
||||
title: 'WROL Mode Enabled',
|
||||
header: 'WROL Mode Enabled',
|
||||
description: 'This cannot be done while WROL Mode is enabled.',
|
||||
time: 5000,
|
||||
});
|
||||
|
|
@ -147,7 +147,7 @@ export async function deleteVideo(video_id) {
|
|||
if (response.status !== 204) {
|
||||
toast({
|
||||
type: 'error',
|
||||
title: 'Unexpected server response',
|
||||
header: 'Unexpected server response',
|
||||
description: 'Failed to delete video. See server logs.',
|
||||
time: 5000,
|
||||
});
|
||||
|
|
@ -223,7 +223,7 @@ export async function encryptOTP(otp, plaintext) {
|
|||
if (response.status !== 200) {
|
||||
toast({
|
||||
type: 'error',
|
||||
title: 'Error!',
|
||||
header: 'Error!',
|
||||
description: 'Failed to encrypt OTP',
|
||||
time: 5000,
|
||||
});
|
||||
|
|
@ -238,7 +238,7 @@ export async function decryptOTP(otp, ciphertext) {
|
|||
if (response.status !== 200) {
|
||||
toast({
|
||||
type: 'error',
|
||||
title: 'Error!',
|
||||
header: 'Error!',
|
||||
description: 'Failed to decrypt OTP',
|
||||
time: 5000,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue