projects
/
ympd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
392cf1e
)
mpd_get_title: call basename only when using path
author
Philippe Mongeau
<ph.mongeau@gmail.com>
Sat, 25 Jan 2014 00:03:16 +0000
(19:03 -0500)
committer
Philippe Mongeau
<ph.mongeau@gmail.com>
Sat, 25 Jan 2014 00:03:16 +0000
(19:03 -0500)
Otherwise, traks like "Morning Bell/Amnesiac" get trimmed to "Amnesiac"
src/mpd_client.c
patch
|
blob
|
history
diff --git
a/src/mpd_client.c
b/src/mpd_client.c
index
b9c0c1a
..
c613dc0
100644
(file)
--- a/
src/mpd_client.c
+++ b/
src/mpd_client.c
@@
-266,8
+266,9
@@
char* mpd_get_title(struct mpd_song const *song)
char *str, *ptr;
str = (char *)mpd_song_get_tag(song, MPD_TAG_TITLE, 0);
- if(str == NULL)
- str = (char *)mpd_song_get_uri(song);
+ if(str == NULL){
+ str = basename((char *)mpd_song_get_uri(song));
+ }
if(str == NULL)
return NULL;
@@
-277,7
+278,7
@@
char* mpd_get_title(struct mpd_song const *song)
if(*ptr=='"')
*ptr='\'';
- return
basename(str)
;
+ return
str
;
}
int mpd_put_state(char *buffer, int *current_song_id, unsigned *queue_version)