mirror of
https://github.com/nimbold/Firelink.git
synced 2026-08-09 18:59:36 +00:00
fix(queue): preserve media terminal states
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user