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.

feat: extend MediaType enum and add new media-related structs for enhanced media handling

Tonhob4659c58e9f3
diff --git a/src-tauri/src/models/media.rs b/src-tauri/src/models/media.rs
index f12476e8..65461bfd 100644
--- a/src-tauri/src/models/media.rs
+++ b/src-tauri/src/models/media.rs
@@ -1,6 +1,8 @@
use serde::{Deserialize, Serialize};
use std::path::PathBuf;
+use crate::platforms::Platform;
+
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MediaInfo {
pub title: String,
@@ -12,10 +14,13 @@ pub struct MediaInfo {
pub media_type: MediaType,
}
-#[derive(Debug, Clone, Serialize, Deserialize)]
+#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub enum MediaType {
Video,
Audio,
+ Photo,
+ Gif,
+ Carousel,
Playlist,
Course,
}
@@ -43,3 +48,29 @@ pub struct DownloadResult {
pub file_size_bytes: u64,
pub duration_seconds: f64,
}
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct MediaItem {
+ pub url: String,
+ pub media_type: MediaType,
+ pub thumbnail_url: Option<String>,
+ pub width: Option<u32>,
+ pub height: Option<u32>,
+ pub duration_seconds: Option<f64>,
+}
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct GenericDownloadResult {
+ pub platform: Platform,
+ pub title: String,
+ pub author: String,
+ pub files: Vec<DownloadedFile>,
+ pub total_bytes: u64,
+}
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct DownloadedFile {
+ pub path: PathBuf,
+ pub media_type: MediaType,
+ pub size_bytes: u64,
+}