diff --git a/CHANGELOG.md b/CHANGELOG.md index bf84ef77..7b6346a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- `%artist` formatting option to only show single artist name + ### Fixed - Missing automatic man page generation for subcommands diff --git a/doc/users.md b/doc/users.md index 2886a367..8468289e 100644 --- a/doc/users.md +++ b/doc/users.md @@ -361,8 +361,9 @@ It's possible to customize how tracks are shown in Queue/Library views and the statusbar, whereas `statusbar_format` will hold the statusbar formatting and `[track_format]` the formatting for tracks in list views. If you don't define `center` for example, the default value will be used. -Available options for tracks: `%artists`, `%title`, `%album`, `%saved`, -`%duration` +Available options for tracks: `%artists`, `%artist`, `%title`, `%album`, `%saved`, +`%duration`. +`%artists` will show all contributing artists, while `%artist` only shows the first listed artist. Default configuration: diff --git a/src/model/playable.rs b/src/model/playable.rs index 9d2a42fc..46689255 100644 --- a/src/model/playable.rs +++ b/src/model/playable.rs @@ -35,6 +35,15 @@ impl Playable { } .as_str(), ) + .replace( + "%artist", + if let Some(artists) = playable.artists() { + artists.first().unwrap().clone().name + } else { + String::new() + } + .as_str(), + ) .replace( "%title", match playable.clone() {