added config
This commit is contained in:
33
src/core/jellyfin.rs
Normal file
33
src/core/jellyfin.rs
Normal file
@@ -0,0 +1,33 @@
|
||||
use super::config::Config;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct JellyfinClient {
|
||||
pub cfg: Config,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct JfItem {
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
pub item_type: String, // "Movie", "Series", etc.
|
||||
pub image_tag: Option<String>,
|
||||
}
|
||||
|
||||
impl JellyfinClient {
|
||||
pub fn new(cfg: Config) -> Self {
|
||||
Self { cfg }
|
||||
}
|
||||
|
||||
// Placeholder for now — next step will use reqwest and actually call Jellyfin.
|
||||
pub fn test_connection_stub(&self) -> Result<String, String> {
|
||||
Ok(format!("Configured for {}", self.cfg.base_url))
|
||||
}
|
||||
|
||||
// Placeholder list so we can wire UI without network yet
|
||||
pub fn list_movies_stub(&self) -> Vec<JfItem> {
|
||||
vec![
|
||||
JfItem { id: "1".into(), name: "Movie A".into(), item_type: "Movie".into(), image_tag: None },
|
||||
JfItem { id: "2".into(), name: "Movie B".into(), item_type: "Movie".into(), image_tag: None },
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user