Skip to content

Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.

add MediaInfo, MediaType, VideoQuality, DownloadOptions, and DownloadResult structs for media management

Tonhoa37a4596be1e
diff --git a/src-tauri/src/models/media.rs b/src-tauri/src/models/media.rs
new file mode 100644
index 00000000..f12476e8
--- /dev/null
+++ b/src-tauri/src/models/media.rs
@@ -0,0 +1,45 @@
+use serde::{Deserialize, Serialize};
+use std::path::PathBuf;
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct MediaInfo {
+ pub title: String,
+ pub author: String,
+ pub platform: String,
+ pub duration_seconds: Option<f64>,
+ pub thumbnail_url: Option<String>,
+ pub available_qualities: Vec<VideoQuality>,
+ pub media_type: MediaType,
+}
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub enum MediaType {
+ Video,
+ Audio,
+ Playlist,
+ Course,
+}
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct VideoQuality {
+ pub label: String,
+ pub width: u32,
+ pub height: u32,
+ pub url: String,
+ pub format: String,
+}
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct DownloadOptions {
+ pub quality: Option<String>,
+ pub output_dir: PathBuf,
+ pub filename_template: Option<String>,
+ pub download_subtitles: bool,
+}
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct DownloadResult {
+ pub file_path: PathBuf,
+ pub file_size_bytes: u64,
+ pub duration_seconds: f64,
+}