feat: add %artist formatting option
* add %artist formating option to only show one artist * add %artist formatting option to only show one artist + docs * punctuation.
This commit is contained in:
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- `%artist` formatting option to only show single artist name
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- Missing automatic man page generation for subcommands
|
- Missing automatic man page generation for subcommands
|
||||||
|
|||||||
@@ -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
|
statusbar, whereas `statusbar_format` will hold the statusbar formatting and
|
||||||
`[track_format]` the formatting for tracks in list views.
|
`[track_format]` the formatting for tracks in list views.
|
||||||
If you don't define `center` for example, the default value will be used.
|
If you don't define `center` for example, the default value will be used.
|
||||||
Available options for tracks: `%artists`, `%title`, `%album`, `%saved`,
|
Available options for tracks: `%artists`, `%artist`, `%title`, `%album`, `%saved`,
|
||||||
`%duration`
|
`%duration`.
|
||||||
|
`%artists` will show all contributing artists, while `%artist` only shows the first listed artist.
|
||||||
|
|
||||||
Default configuration:
|
Default configuration:
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,15 @@ impl Playable {
|
|||||||
}
|
}
|
||||||
.as_str(),
|
.as_str(),
|
||||||
)
|
)
|
||||||
|
.replace(
|
||||||
|
"%artist",
|
||||||
|
if let Some(artists) = playable.artists() {
|
||||||
|
artists.first().unwrap().clone().name
|
||||||
|
} else {
|
||||||
|
String::new()
|
||||||
|
}
|
||||||
|
.as_str(),
|
||||||
|
)
|
||||||
.replace(
|
.replace(
|
||||||
"%title",
|
"%title",
|
||||||
match playable.clone() {
|
match playable.clone() {
|
||||||
|
|||||||
Reference in New Issue
Block a user