Major refactor

This commit is contained in:
2026-04-03 23:04:51 -04:00
parent e7f337c735
commit 35d07e8df1
124 changed files with 4929 additions and 2429 deletions

View File

@@ -0,0 +1,35 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize)]
#[serde(untagged)]
pub enum YtDlpItem {
PlaylistItem {
id: String,
url: String,
title: String,
duration: Option<f64>,
playlist_index: Option<i32>,
},
VideoItem {
id: String,
webpage_url: String,
title: String,
duration: Option<f64>,
},
}
impl YtDlpItem {
pub fn get_title(&self) -> &str {
match self {
YtDlpItem::PlaylistItem { title, .. } => title,
YtDlpItem::VideoItem { title, .. } => title,
}
}
pub fn get_url(&self) -> &str {
match self {
YtDlpItem::PlaylistItem { url, .. } => url,
YtDlpItem::VideoItem { webpage_url, .. } => webpage_url,
}
}
}