mirror of
https://github.com/neosubhamoy/neodlp.git
synced 2025-12-20 07:49:33 +05:30
(chore): initial MVP release v0.1.0
This commit is contained in:
77
src/types/download.ts
Normal file
77
src/types/download.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
export interface DownloadState {
|
||||
download_id: string;
|
||||
download_status: string;
|
||||
video_id: string;
|
||||
format_id: string;
|
||||
subtitle_id: string | null;
|
||||
queue_index: number | null;
|
||||
playlist_id: string | null;
|
||||
playlist_index: number | null;
|
||||
title: string;
|
||||
url: string;
|
||||
host: string;
|
||||
thumbnail: string | null;
|
||||
channel: string | null;
|
||||
duration_string: string | null;
|
||||
release_date: string | null;
|
||||
view_count: number | null;
|
||||
like_count: number | null;
|
||||
playlist_title: string;
|
||||
playlist_url: string;
|
||||
playlist_n_entries: number;
|
||||
playlist_channel: string | null;
|
||||
resolution: string | null;
|
||||
ext: string | null;
|
||||
abr: number | null;
|
||||
vbr: number | null;
|
||||
acodec: string | null;
|
||||
vcodec: string | null;
|
||||
dynamic_range: string | null;
|
||||
process_id: number | null;
|
||||
status: string | null;
|
||||
progress: number | null;
|
||||
total: number | null;
|
||||
downloaded: number | null;
|
||||
speed: number | null;
|
||||
eta: number | null;
|
||||
filepath: string | null;
|
||||
filetype: string | null;
|
||||
filesize: number | null;
|
||||
}
|
||||
|
||||
export interface Download {
|
||||
download_id: string;
|
||||
download_status: string;
|
||||
video_id: string;
|
||||
format_id: string;
|
||||
subtitle_id: string | null;
|
||||
queue_index: number | null;
|
||||
playlist_id: string | null;
|
||||
playlist_index: number | null;
|
||||
resolution: string | null;
|
||||
ext: string | null;
|
||||
abr: number | null;
|
||||
vbr: number | null;
|
||||
acodec: string | null;
|
||||
vcodec: string | null;
|
||||
dynamic_range: string | null;
|
||||
process_id: number | null;
|
||||
status: string | null;
|
||||
progress: number | null;
|
||||
total: number | null;
|
||||
downloaded: number | null;
|
||||
speed: number | null;
|
||||
eta: number | null;
|
||||
filepath: string | null;
|
||||
filetype: string | null;
|
||||
filesize: number | null;
|
||||
}
|
||||
|
||||
export interface DownloadProgress {
|
||||
status: string | null;
|
||||
progress: number | null;
|
||||
speed: number | null;
|
||||
downloaded: number | null;
|
||||
total: number | null;
|
||||
eta: number | null;
|
||||
}
|
||||
9
src/types/kvStore.ts
Normal file
9
src/types/kvStore.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export interface KvStoreTable {
|
||||
key: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface KvStore {
|
||||
ytdlp_update_last_check: number | null;
|
||||
macos_registered_version: string | null;
|
||||
}
|
||||
7
src/types/playlist.ts
Normal file
7
src/types/playlist.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export interface PlaylistInfo {
|
||||
playlist_id: string,
|
||||
playlist_title: string,
|
||||
playlist_url: string,
|
||||
playlist_n_entries: number,
|
||||
playlist_channel: string | null,
|
||||
}
|
||||
8
src/types/route.ts
Normal file
8
src/types/route.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { LucideProps } from "lucide-react";
|
||||
|
||||
export interface RoutesObj {
|
||||
title: string;
|
||||
url: string;
|
||||
icon: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
||||
starts_with?: boolean | null;
|
||||
}
|
||||
16
src/types/settings.ts
Normal file
16
src/types/settings.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
export interface SettingsTable {
|
||||
key: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface Settings {
|
||||
ytdlp_update_channel: string;
|
||||
ytdlp_auto_update: boolean;
|
||||
theme: 'dark' | 'light' | 'system';
|
||||
download_dir: string;
|
||||
max_parallel_downloads: number;
|
||||
prefer_video_over_playlist: boolean;
|
||||
use_proxy: boolean;
|
||||
proxy_url: string;
|
||||
websocket_port: number;
|
||||
}
|
||||
96
src/types/store.ts
Normal file
96
src/types/store.ts
Normal file
@@ -0,0 +1,96 @@
|
||||
import { DownloadState } from "@/types/download";
|
||||
import { RawVideoInfo } from "@/types/video";
|
||||
import { Settings } from "@/types/settings";
|
||||
import { KvStore } from "@/types/kvStore";
|
||||
import { Update } from "@tauri-apps/plugin-updater";
|
||||
|
||||
export interface BasePathsStore {
|
||||
ffmpegPath: string | null;
|
||||
tempDownloadDirPath: string | null;
|
||||
downloadDirPath: string | null;
|
||||
setPath: (key: string, path: string) => void;
|
||||
}
|
||||
|
||||
export interface DownloadStatesStore {
|
||||
downloadStates: DownloadState[];
|
||||
setDownloadStates: (state: DownloadState[]) => void;
|
||||
setDownloadState: (state: DownloadState) => void;
|
||||
}
|
||||
|
||||
export interface CurrentVideoMetadataStore {
|
||||
videoUrl: string;
|
||||
videoMetadata: RawVideoInfo | null;
|
||||
isMetadataLoading: boolean;
|
||||
requestedUrl: string;
|
||||
autoSubmitSearch: boolean;
|
||||
setVideoUrl: (url: string) => void;
|
||||
setVideoMetadata: (metadata: RawVideoInfo | null) => void;
|
||||
setIsMetadataLoading: (isLoading: boolean) => void;
|
||||
setRequestedUrl: (url: string) => void;
|
||||
setAutoSubmitSearch: (autoSubmit: boolean) => void;
|
||||
}
|
||||
|
||||
export interface DownloaderPageStatesStore {
|
||||
isStartingDownload: boolean;
|
||||
selctedDownloadFormat: string;
|
||||
selectedSubtitles: string[];
|
||||
selectedPlaylistVideoIndex: string;
|
||||
setIsStartingDownload: (isStarting: boolean) => void;
|
||||
setSelctedDownloadFormat: (format: string) => void;
|
||||
setSelectedSubtitles: (subtitles: string[]) => void;
|
||||
setSelectedPlaylistVideoIndex: (index: string) => void;
|
||||
}
|
||||
|
||||
export interface DownloadActionStatesStore {
|
||||
downloadActions: {
|
||||
[download_id: string]: {
|
||||
isResuming: boolean;
|
||||
isPausing: boolean;
|
||||
isCanceling: boolean;
|
||||
isDeleteFileChecked: boolean;
|
||||
}
|
||||
};
|
||||
setIsResumingDownload: (download_id: string, isResuming: boolean) => void;
|
||||
setIsPausingDownload: (download_id: string, isPausing: boolean) => void;
|
||||
setIsCancelingDownload: (download_id: string, isCanceling: boolean) => void;
|
||||
setIsDeleteFileChecked: (download_id: string, isDeleteFileChecked: boolean) => void;
|
||||
}
|
||||
|
||||
export interface SettingsPageStatesStore {
|
||||
activeTab: string;
|
||||
appVersion: string | null;
|
||||
isFetchingAppVersion: boolean;
|
||||
ytDlpVersion: string | null;
|
||||
isFetchingYtDlpVersion: boolean;
|
||||
isUpdatingYtDlp: boolean;
|
||||
settings: Settings;
|
||||
isUsingDefaultSettings: boolean;
|
||||
isChangingWebSocketPort: boolean;
|
||||
isRestartingWebSocketServer: boolean;
|
||||
isCheckingAppUpdate: boolean;
|
||||
appUpdate: Update | null;
|
||||
isUpdatingApp: boolean;
|
||||
appUpdateDownloadProgress: number;
|
||||
setActiveTab: (tab: string) => void;
|
||||
setAppVersion: (version: string | null) => void;
|
||||
setIsFetchingAppVersion: (isFetching: boolean) => void;
|
||||
setYtDlpVersion: (version: string | null) => void;
|
||||
setIsFetchingYtDlpVersion: (isFetching: boolean) => void;
|
||||
setIsUpdatingYtDlp: (isUpdating: boolean) => void;
|
||||
setSettingsKey: (key: string, value: unknown) => void;
|
||||
setSettings: (settings: Settings) => void;
|
||||
resetSettings: () => void;
|
||||
setIsUsingDefaultSettings: (isUsingDefault: boolean) => void;
|
||||
setIsChangingWebSocketPort: (isChanging: boolean) => void;
|
||||
setIsRestartingWebSocketServer: (isRestarting: boolean) => void;
|
||||
setIsCheckingAppUpdate: (isChecking: boolean) => void;
|
||||
setAppUpdate: (update: Update | null) => void;
|
||||
setIsUpdatingApp: (isUpdating: boolean) => void;
|
||||
setAppUpdateDownloadProgress: (progress: number) => void;
|
||||
}
|
||||
|
||||
export interface KvPairsStatesStore {
|
||||
kvPairs: KvStore
|
||||
setKvPairsKey: (key: string, value: unknown) => void;
|
||||
setKvPairs: (kvPairs: KvStore) => void;
|
||||
}
|
||||
82
src/types/video.ts
Normal file
82
src/types/video.ts
Normal file
@@ -0,0 +1,82 @@
|
||||
export interface RawVideoInfo {
|
||||
id: string;
|
||||
title: string;
|
||||
original_url: string;
|
||||
webpage_url: string;
|
||||
webpage_url_domain: string;
|
||||
thumbnail: string;
|
||||
channel: string;
|
||||
uploader: string;
|
||||
duration_string: string;
|
||||
release_date: string;
|
||||
upload_date: string;
|
||||
view_count: number;
|
||||
like_count: number;
|
||||
resolution: string;
|
||||
ext: string;
|
||||
abr: number;
|
||||
vbr: number;
|
||||
tbr: number;
|
||||
acodec: string;
|
||||
vcodec: string;
|
||||
audio_ext: string;
|
||||
video_ext: string;
|
||||
fps: number;
|
||||
dynamic_range: string;
|
||||
aspect_ratio: number;
|
||||
_type: string;
|
||||
extractor: string;
|
||||
filesize_approx: number;
|
||||
subtitles: {
|
||||
[subtitle_id: string]: VideoSubtitle[];
|
||||
};
|
||||
formats: VideoFormat[];
|
||||
requested_downloads: VideoFormat[];
|
||||
requested_subtitles: {
|
||||
[subtitle_id: string]: VideoSubtitle;
|
||||
};
|
||||
playlist_id: string;
|
||||
playlist_title: string;
|
||||
playlist_channel: string;
|
||||
playlist_uploader: string;
|
||||
playlist_webpage_url: string;
|
||||
entries: RawVideoInfo[];
|
||||
n_entries: number;
|
||||
playlist_count: number;
|
||||
playlist_index: number;
|
||||
}
|
||||
|
||||
export interface VideoInfo {
|
||||
video_id: string;
|
||||
title: string;
|
||||
url: string;
|
||||
host: string;
|
||||
thumbnail: string | null;
|
||||
channel: string | null;
|
||||
duration_string: string | null;
|
||||
release_date: string | null;
|
||||
view_count: number | null;
|
||||
like_count: number | null;
|
||||
}
|
||||
|
||||
export interface VideoFormat {
|
||||
format_id: string;
|
||||
format: string;
|
||||
format_note: string;
|
||||
ext: string;
|
||||
resolution: string | null;
|
||||
filesize_approx: number | null;
|
||||
dynamic_range?: string | null;
|
||||
vcodec?: string | null;
|
||||
acodec?: string | null;
|
||||
video_ext?: string | null;
|
||||
audio_ext?: string | null;
|
||||
tbr?: number | null;
|
||||
fps?: number | null;
|
||||
}
|
||||
|
||||
export interface VideoSubtitle {
|
||||
ext: string;
|
||||
url: string;
|
||||
name: string;
|
||||
}
|
||||
5
src/types/websocket.ts
Normal file
5
src/types/websocket.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export interface WebSocketMessage {
|
||||
url: string;
|
||||
command: string;
|
||||
argument: string;
|
||||
}
|
||||
Reference in New Issue
Block a user