feat: add base jellyfin and ersatztv sdk

This commit is contained in:
Alexander Navarro 2025-10-18 17:53:06 -03:00
commit 49cf01c668
11 changed files with 2184 additions and 0 deletions

50
src/jellyfin/models.rs Normal file
View file

@ -0,0 +1,50 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct GetItemsQueryStringModel {
pub parent_id: String,
pub sort_by: String,
pub fields: String,
pub enable_images: bool,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct GetItemsResponseModel {
pub items: Vec<ItemModel>,
pub total_record_count: u64,
pub start_index: u64,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ItemModel {
pub name: String,
pub id: String,
pub path: String,
pub production_year: Option<i64>,
pub is_folder: bool,
#[serde(rename = "Type")]
pub type_field: String,
pub artists: Option<Vec<String>>,
pub artist_items: Option<Vec<ArtistItemModel>>,
pub album_artist: Option<String>,
pub album_artists: Option<Vec<AlbumArtistModel>>,
pub media_type: String,
pub recursive_item_count: u64,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ArtistItemModel {
pub name: String,
pub id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct AlbumArtistModel {
pub name: String,
pub id: String,
}