feat: added custom commands, per-download configs and other minor improvements

This commit is contained in:
2025-10-05 21:21:26 +05:30
parent 9498464fa2
commit 3046daffd8
12 changed files with 772 additions and 173 deletions

View File

@@ -43,6 +43,7 @@ export interface DownloadState {
sponsorblock_remove: string | null;
sponsorblock_mark: string | null;
use_aria2: number;
custom_command: string | null;
created_at?: string;
updated_at?: string;
}
@@ -79,6 +80,7 @@ export interface Download {
sponsorblock_remove: string | null;
sponsorblock_mark: string | null;
use_aria2: number;
custom_command: string | null;
created_at: string;
updated_at: string;
}

View File

@@ -3,6 +3,12 @@ export interface SettingsTable {
value: string;
}
export interface CustomCommand {
id: string;
label: string;
args: string;
}
export interface Settings {
ytdlp_update_channel: string;
ytdlp_auto_update: boolean;
@@ -35,6 +41,15 @@ export interface Settings {
use_aria2: boolean;
use_force_internet_protocol: boolean;
force_internet_protocol: string;
use_custom_commands: boolean;
custom_commands: CustomCommand[];
// extension settings
websocket_port: number;
}
export interface DownloadConfiguration {
output_format: string | null;
embed_metadata: boolean | null;
embed_thumbnail: boolean | null;
custom_command: string | null;
}

View File

@@ -1,6 +1,6 @@
import { DownloadState } from "@/types/download";
import { RawVideoInfo } from "@/types/video";
import { Settings } from "@/types/settings";
import { DownloadConfiguration, Settings } from "@/types/settings";
import { KvStore } from "@/types/kvStore";
import { Update } from "@tauri-apps/plugin-updater";
import { Log } from "@/types/logs";
@@ -37,22 +37,28 @@ export interface CurrentVideoMetadataStore {
export interface DownloaderPageStatesStore {
activeDownloadModeTab: string;
activeDownloadConfigurationTab: string;
isStartingDownload: boolean;
selectedDownloadFormat: string;
selectedCombinableVideoFormat: string;
selectedCombinableAudioFormat: string;
selectedSubtitles: string[];
selectedPlaylistVideoIndex: string;
downloadConfiguration: DownloadConfiguration;
isErrored: boolean;
isErrorExpected: boolean;
erroredDownloadId: string | null;
setActiveDownloadModeTab: (tab: string) => void;
setActiveDownloadConfigurationTab: (tab: string) => void;
setIsStartingDownload: (isStarting: boolean) => void;
setSelectedDownloadFormat: (format: string) => void;
setSelectedCombinableVideoFormat: (format: string) => void;
setSelectedCombinableAudioFormat: (format: string) => void;
setSelectedSubtitles: (subtitles: string[]) => void;
setSelectedPlaylistVideoIndex: (index: string) => void;
setDownloadConfigurationKey: (key: string, value: unknown) => void;
setDownloadConfiguration: (config: DownloadConfiguration) => void;
resetDownloadConfiguration: () => void;
setIsErrored: (isErrored: boolean) => void;
setIsErrorExpected: (isErrorExpected: boolean) => void;
setErroredDownloadId: (downloadId: string | null) => void;