mirror of
https://github.com/SuperBFG7/ympd
synced 2024-12-27 03:10:26 +00:00
Merge pull request #5 from phmongeau/fix_mpd_get_title
mpd_get_title: call basename only when using path
This commit is contained in:
commit
88abc57a6e
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user