Skip to content

Commit

Permalink
Fix #61
Browse files Browse the repository at this point in the history
Changed it to actually get 128 chars and not 128 bytes

Co-authored-by: Ella Stanforth <[email protected]>
  • Loading branch information
Radiicall and Ella-0 committed Aug 31, 2023
1 parent cf75a94 commit c80dd79
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "jellyfin-rpc"
version = "0.14.5"
version = "0.14.6"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
4 changes: 2 additions & 2 deletions src/services/jellyfin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ impl Content {

// Check that details and state_message arent over the max length allowed by discord, if they are then they have to be trimmed down because discord wont display the activity otherwise
if content.details.len() > 128 {
content.details(content.details[0..128].to_string());
content.details(content.details.chars().take(128).collect());
}

if content.state_message.len() > 128 {
content.state_message(content.state_message[0..128].to_string());
content.state_message(content.state_message.chars().take(128).collect());
}

let mut image_url: String = "".to_string();
Expand Down

0 comments on commit c80dd79

Please sign in to comment.