From b0277ae94a2a64038bc7db5974323f91cf9d4e70 Mon Sep 17 00:00:00 2001 From: Radiicall Date: Wed, 17 Apr 2024 21:04:42 +0200 Subject: [PATCH 1/3] Fix issue with movies and bump version --- Cargo.lock | 22 +++------------------- jellyfin-rpc/Cargo.toml | 2 +- jellyfin-rpc/src/services/jellyfin.rs | 21 ++++++++++++--------- 3 files changed, 16 insertions(+), 29 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index acfead2..1d51c32 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -477,23 +477,7 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jellyfin-rpc" -version = "1.0.3" -dependencies = [ - "async-recursion", - "colored", - "discord-rich-presence", - "reqwest", - "retry", - "serde", - "serde_json", - "tokio", -] - -[[package]] -name = "jellyfin-rpc" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f50c9aa76f876cb16b5ca0879140ac24a487023ce7e65fec420032269a4c87f" +version = "1.0.4" dependencies = [ "async-recursion", "colored", @@ -507,12 +491,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", "reqwest", "retry", "tokio", 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); From 6535a069a4a5b2dff71041ca7e3b6204dab0f5dc Mon Sep 17 00:00:00 2001 From: Radiicall Date: Wed, 17 Apr 2024 21:04:59 +0200 Subject: [PATCH 2/3] bump version --- jellyfin-rpc-cli/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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] From a9c1b928a33beb91e5273522026e7533e7a3121d Mon Sep 17 00:00:00 2001 From: Radiicall Date: Wed, 17 Apr 2024 21:08:58 +0200 Subject: [PATCH 3/3] Update lock file --- Cargo.lock | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 1d51c32..701cb59 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -489,6 +489,22 @@ dependencies = [ "tokio", ] +[[package]] +name = "jellyfin-rpc" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a03dcb1c6447bb4b7699b08cba07aa4722f61ab60537d411e12815518d8b901e" +dependencies = [ + "async-recursion", + "colored", + "discord-rich-presence", + "reqwest", + "retry", + "serde", + "serde_json", + "tokio", +] + [[package]] name = "jellyfin-rpc-cli" version = "1.0.4" @@ -496,7 +512,7 @@ dependencies = [ "clap", "colored", "discord-rich-presence", - "jellyfin-rpc", + "jellyfin-rpc 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest", "retry", "tokio",