Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge main into logging #113

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions jellyfin-rpc-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion jellyfin-rpc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
21 changes: 12 additions & 9 deletions jellyfin-rpc/src/services/jellyfin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,32 +223,35 @@ 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<String> 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);
}
};

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);
Expand Down
Loading