Skip to content

Commit

Permalink
Change separator char to String (#89) (#90)
Browse files Browse the repository at this point in the history
allows multicharacter separators in music display
  • Loading branch information
Radiicall authored Nov 29, 2023
1 parent aa0fd4e commit fcb1373
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 24 deletions.
18 changes: 1 addition & 17 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
Expand Up @@ -27,8 +27,8 @@ retry = "2.0"

[dependencies.jellyfin-rpc]
features = ["imgur", "cli"]
version = "0.1.5"
#path = "../jellyfin-rpc"
#version = "0.1.5"
path = "../jellyfin-rpc"

[dependencies.clap]
features = ["derive"]
Expand Down
2 changes: 1 addition & 1 deletion jellyfin-rpc/src/core/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub struct Music {
/// Example: `vec![String::from("genres"), String::from("year")]`
pub display: Option<Display>,
/// Separator is what should be between the artist(s) and the `display` options.
pub separator: Option<char>,
pub separator: Option<String>,
}

/// Display is where you tell the program what should be displayed.
Expand Down
6 changes: 3 additions & 3 deletions jellyfin-rpc/src/services/jellyfin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,10 @@ impl Content {
.music
.clone()
.and_then(|music| music.separator)
.unwrap_or('-');
.unwrap_or("-".to_string());

let state =
Content::get_music_info(now_playing_item, artists, display, name, separator).await;
Content::get_music_info(now_playing_item, artists, display, name, &separator).await;

content.media_type(MediaType::Music);
content.details(name.into());
Expand Down Expand Up @@ -371,7 +371,7 @@ impl Content {
artists: String,
display: Vec<std::string::String>,
name: &str,
separator: char,
separator: &str,
) -> String {
let mut state = format!("By {}", artists);

Expand Down
2 changes: 1 addition & 1 deletion jellyfin-rpc/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fn load_example_config() {
username: Username::String("your_username_here".to_string()),
music: Some(Music {
display: Some(Display::String("genres".to_string())),
separator: Some('-'),
separator: Some("-".to_string()),
}),
blacklist: Some(Blacklist {
media_types: Some(vec![
Expand Down

0 comments on commit fcb1373

Please sign in to comment.