fix(queue): preserve media terminal states

This commit is contained in:
NimBold
2026-06-18 07:26:40 +03:30
parent 18de275d42
commit 605992439d
6 changed files with 133 additions and 50 deletions
+11
View File
@@ -1,4 +1,5 @@
import type { DownloadCategory } from '../bindings/DownloadCategory';
import type { DownloadStatus } from '../bindings/DownloadStatus';
export type { DownloadCategory } from '../bindings/DownloadCategory';
import { invoke } from '@tauri-apps/api/core';
@@ -19,6 +20,16 @@ let MEDIA_DOMAINS = [
'fb.watch'
];
const ACTIVE_DOWNLOAD_STATUSES: ReadonlySet<DownloadStatus> = new Set([
'queued',
'downloading',
'processing',
'retrying',
]);
export const isActiveDownloadStatus = (status: DownloadStatus): boolean =>
ACTIVE_DOWNLOAD_STATUSES.has(status);
export const initMediaDomains = async () => {
try {
const domains = await invoke<string[]>('get_supported_media_domains');