summaryrefslogtreecommitdiff
path: root/src/song.cpp
diff options
context:
space:
mode:
authorAndrzej Rybczak <electricityispower@gmail.com>2015-06-13 20:43:36 +0200
committerAndrzej Rybczak <electricityispower@gmail.com>2015-06-13 20:45:18 +0200
commita3d536b4228637067df9697c11bcf3434883a943 (patch)
treeb92971ac3eb6e23ddd37a8905efa7d928abc80d9 /src/song.cpp
parent20a4e486cc36e40afc202e3794772e402b1d3c0f (diff)
song: show name if it's available
Diffstat (limited to 'src/song.cpp')
-rw-r--r--src/song.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/song.cpp b/src/song.cpp
index c7d07ba7..3498e37f 100644
--- a/src/song.cpp
+++ b/src/song.cpp
@@ -74,7 +74,9 @@ std::string Song::getName(unsigned idx) const
assert(m_song);
mpd_song *s = m_song.get();
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 "";
const char *uri = mpd_song_get_uri(s);
const char *name = strrchr(uri, '/');