diff --git a/Cargo.lock b/Cargo.lock index 25f6a77..abf3402 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -489,22 +489,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "jellyfin-rpc" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9160f4e7888ba0c73e1fe8390a9e5388bfa5e9bfabbbc2b499e7e877eb35ca7" -dependencies = [ - "async-recursion", - "colored", - "discord-rich-presence", - "reqwest", - "retry", - "serde", - "serde_json", - "tokio", -] - [[package]] name = "jellyfin-rpc-cli" version = "1.0.2" @@ -512,7 +496,7 @@ dependencies = [ "clap", "colored", "discord-rich-presence", - "jellyfin-rpc 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "jellyfin-rpc", "reqwest", "retry", "tokio", diff --git a/jellyfin-rpc-cli/Cargo.toml b/jellyfin-rpc-cli/Cargo.toml index 976cc60..a5684f7 100644 --- a/jellyfin-rpc-cli/Cargo.toml +++ b/jellyfin-rpc-cli/Cargo.toml @@ -27,8 +27,8 @@ retry = "2.0" [dependencies.jellyfin-rpc] features = ["imgur", "cli"] -version = "1.0.2" -#path = "../jellyfin-rpc" +#version = "1.0.2" +path = "../jellyfin-rpc" [dependencies.clap] features = ["derive"] diff --git a/jellyfin-rpc-cli/src/main.rs b/jellyfin-rpc-cli/src/main.rs index 0249a93..08379f9 100644 --- a/jellyfin-rpc-cli/src/main.rs +++ b/jellyfin-rpc-cli/src/main.rs @@ -250,15 +250,11 @@ async fn main() -> Result<(), Box> { // Set the activity let mut rpcbuttons: Vec = vec![]; let mut x = 0; - let default_button = config::Button { - name: String::from("dynamic"), - url: String::from("dynamic"), - }; let buttons = config .clone() .discord .and_then(|discord| discord.buttons) - .unwrap_or(vec![default_button.clone(), default_button]); + .unwrap_or(vec![config::Button::default(), config::Button::default()]); // For loop to determine if external services are to be used or if there are custom buttons instead for button in buttons.iter() { diff --git a/jellyfin-rpc/src/core/config.rs b/jellyfin-rpc/src/core/config.rs index 653ed32..364b751 100644 --- a/jellyfin-rpc/src/core/config.rs +++ b/jellyfin-rpc/src/core/config.rs @@ -103,6 +103,15 @@ pub struct Button { pub url: String, } +impl Default for Button { + fn default() -> Self { + Self { + name: String::from("dynamic"), + url: String::from("dynamic"), + } + } +} + /// Imgur configuration #[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] pub struct Imgur {