song: show name if it's available
This commit is contained in:
1
NEWS
1
NEWS
@@ -6,6 +6,7 @@ ncmpcpp-0.6.5 (????-??-??)
|
|||||||
* When numbering tracks in tag editor all the other track tags are discarded.
|
* When numbering tracks in tag editor all the other track tags are discarded.
|
||||||
* Xiph tag DESCRIPTION is now rewritten as COMMENT when updating tags.
|
* Xiph tag DESCRIPTION is now rewritten as COMMENT when updating tags.
|
||||||
* Possible access of already freed memory when downloading artist info is fixed.
|
* Possible access of already freed memory when downloading artist info is fixed.
|
||||||
|
* Name of an item is now displayed correctly if present.
|
||||||
|
|
||||||
ncmpcpp-0.6.4 (2015-05-02)
|
ncmpcpp-0.6.4 (2015-05-02)
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,9 @@ std::string Song::getName(unsigned idx) const
|
|||||||
assert(m_song);
|
assert(m_song);
|
||||||
mpd_song *s = m_song.get();
|
mpd_song *s = m_song.get();
|
||||||
const char *res = mpd_song_get_tag(s, MPD_TAG_NAME, idx);
|
const char *res = mpd_song_get_tag(s, MPD_TAG_NAME, idx);
|
||||||
if (!res && idx > 0)
|
if (res)
|
||||||
|
return res;
|
||||||
|
else if (idx > 0)
|
||||||
return "";
|
return "";
|
||||||
const char *uri = mpd_song_get_uri(s);
|
const char *uri = mpd_song_get_uri(s);
|
||||||
const char *name = strrchr(uri, '/');
|
const char *name = strrchr(uri, '/');
|
||||||
|
|||||||
Reference in New Issue
Block a user