diff --git a/Cargo.lock b/Cargo.lock index acfead2..701cb59 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -477,7 +477,7 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jellyfin-rpc" -version = "1.0.3" +version = "1.0.4" dependencies = [ "async-recursion", "colored", @@ -491,9 +491,9 @@ dependencies = [ [[package]] name = "jellyfin-rpc" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f50c9aa76f876cb16b5ca0879140ac24a487023ce7e65fec420032269a4c87f" +checksum = "a03dcb1c6447bb4b7699b08cba07aa4722f61ab60537d411e12815518d8b901e" dependencies = [ "async-recursion", "colored", @@ -507,12 +507,12 @@ dependencies = [ [[package]] name = "jellyfin-rpc-cli" -version = "1.0.3" +version = "1.0.4" dependencies = [ "clap", "colored", "discord-rich-presence", - "jellyfin-rpc 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "jellyfin-rpc 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest", "retry", "tokio", diff --git a/jellyfin-rpc-cli/Cargo.toml b/jellyfin-rpc-cli/Cargo.toml index 7b27b87..12e7000 100644 --- a/jellyfin-rpc-cli/Cargo.toml +++ b/jellyfin-rpc-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jellyfin-rpc-cli" -version = "1.0.3" +version = "1.0.4" edition = "2021" description = "Displays the content you're currently watching on Discord!" license = "GPL-3.0-or-later" @@ -27,7 +27,7 @@ retry = "2.0" [dependencies.jellyfin-rpc] features = ["imgur", "cli"] -version = "1.0.3" +version = "1.0.4" #path = "../jellyfin-rpc" [dependencies.clap] diff --git a/jellyfin-rpc/Cargo.toml b/jellyfin-rpc/Cargo.toml index ef60762..58aefa8 100644 --- a/jellyfin-rpc/Cargo.toml +++ b/jellyfin-rpc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jellyfin-rpc" -version = "1.0.3" +version = "1.0.4" edition = "2021" description = "Backend for the Jellyfin-RPC-cli and Jellyfin-RPC-Iced projects" license = "GPL-3.0-or-later" diff --git a/jellyfin-rpc/src/services/jellyfin.rs b/jellyfin-rpc/src/services/jellyfin.rs index b8dcfa4..2ca595d 100644 --- a/jellyfin-rpc/src/services/jellyfin.rs +++ b/jellyfin-rpc/src/services/jellyfin.rs @@ -223,24 +223,27 @@ impl Content { After the for loop is complete we remove the trailing ", " because it looks bad in the presence. Then we send it off as a Vec with the external urls and the end timer to the main loop. */ - let name = if config.jellyfin.show_simple? { - "" - } else { - now_playing_item["Name"].as_str()? - }; + + let mut name = now_playing_item["Name"].as_str()?; + if now_playing_item["Type"].as_str()? == "Episode" { let season = now_playing_item["ParentIndexNumber"].as_i64().unwrap_or(0) as i32; let first_episode_number = now_playing_item["IndexNumber"].as_i64().unwrap_or(0) as i32; let mut state; - if config.jellyfin.append_prefix? { - if config.jellyfin.add_divider? { + + if config.jellyfin.show_simple.unwrap_or(false) { + name = "" + }; + + if config.jellyfin.append_prefix.unwrap_or(false) { + if config.jellyfin.add_divider.unwrap_or(false) { state = format!("S{:02} - E{:02}", season, first_episode_number); } else { state = format!("S{:02}E{:02}", season, first_episode_number); } } else { - if config.jellyfin.add_divider? { + if config.jellyfin.add_divider.unwrap_or(false) { state = format!("S{} - E{}", season, first_episode_number); } else { state = format!("S{}E{}", season, first_episode_number); @@ -248,7 +251,7 @@ impl Content { }; if season.to_string() == *"null" { - if config.jellyfin.append_prefix? { + if config.jellyfin.append_prefix.unwrap_or(false) { state = format!("E{:02}", first_episode_number); } else { state = format!("E{}", first_episode_number);