-
Notifications
You must be signed in to change notification settings - Fork 43
Displaying tags that can have multiple values #128
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
Conversation
|
Also tested new implementation, it correctly cuts off artists names that are too long. |
src/song_format.c
Outdated
| { | ||
| const char *value = mpd_song_get_tag(song, tag, 0); | ||
| if (value == NULL) | ||
| return dest; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this line, song_value() returns an empty string instead of NULL when there is no tag value - did you intend to change the API contract or was this accidental?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops! That is indeed accidental.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PS: this line is actually more buggy than that - it returns a string that's not null-terminated, but your API docs say it's guaranteed to be null-terminated.
|
Alright, fixed the two more points you brought up. |
|
This looks good now - but can you please fold all fixup commits into the first commit? |
Yeah! I thought github allows for a squash merge, but i can do it manually from this side as well. |
|
I don't use any web interface for anything (other than commenting here). I use git, not GitHub - GitHub is just a random git server. |
|
I meant the git function, which is accessible from the github interface but also from git itself :) |
But that would make your job mine. And then happens what happens with your branch: just look at the confusing commit message. "display tags with multiple values in song formatting When somebody looks at this commit in 10 years, what will they make from it? |
|
In my humble opinion, it is not only the end result but also the process that matters, as that too can give insight into development history. |
|
There is no historical value in knowing what mistakes you made in commits that were never merged. |
|
clang found another bug in your code: And indeed, you forgot to initialize the variable in one code path. |
|
Good catch. Curious, seems to not have been detected on my machine. |
|
Unit tests fail. |
|
GH actions currently doesn't show details about the unit test failures; I just pushed a change that prints those details. Next time you push, rebase first! |
cdbce69 to
969c928
Compare
|
rebased an fixed error that caused it to fail. |
|
Good to have unit tests - it caught another mistake. |
Replaced existing functionality that only took the first found tag with a function that concatenates all the found tags with a comma delimiter. Allows displaying multiple artists, albums, etc. Function implemetation mostly based on the one in ncmpc.
|
Added unit test. |
Add functionality to display e.g. multiple artists.
Separation is done with
||, in line with the style that other popular mpc clients use (ncmpcpp, rmpc).Example output of
mpc statusfor a song with two artists using this fix:Fixes #120.