add vid_type filter for download list view

This commit is contained in:
Simon
2025-07-06 16:01:55 +07:00
parent 28ac0ba620
commit 8d9cb9261e
4 changed files with 40 additions and 3 deletions

View File

@@ -1,11 +1,17 @@
import APIClient from '../../functions/APIClient';
import { DownloadResponseType } from '../../pages/Download';
const loadDownloadQueue = async (page: number, channelId: string | null, showIgnored: boolean) => {
const loadDownloadQueue = async (
page: number,
channelId: string | null,
vid_type: string | null,
showIgnored: boolean,
) => {
const searchParams = new URLSearchParams();
if (page) searchParams.append('page', page.toString());
if (channelId) searchParams.append('channel', channelId);
if (vid_type) searchParams.append('vid_type', vid_type);
searchParams.append('filter', showIgnored ? 'ignore' : 'pending');
const endpoint = `/api/download/${searchParams.toString() ? `?${searchParams.toString()}` : ''}`;