From 6f8d5ef73284b001ad6b343868b36f3753275e56 Mon Sep 17 00:00:00 2001 From: Philippe Mongeau Date: Fri, 24 Jan 2014 19:03:16 -0500 Subject: [PATCH] mpd_get_title: call basename only when using path Otherwise, traks like "Morning Bell/Amnesiac" get trimmed to "Amnesiac" --- src/mpd_client.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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) -- 2.20.1