From: Philippe Mongeau Date: Sat, 25 Jan 2014 00:03:16 +0000 (-0500) Subject: mpd_get_title: call basename only when using path X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=567578473e4c7328487bd014dcb5053cfe3d8f2d;p=ympd.git mpd_get_title: call basename only when using path Otherwise, traks like "Morning Bell/Amnesiac" get trimmed to "Amnesiac" --- diff --git a/src/mpd_client.c b/src/mpd_client.c index b9c0c1a..c613dc0 100644 --- 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)