make check if file is from music db while getting song info

This commit is contained in:
Andrzej Rybczak
2008-11-04 16:17:58 +01:00
parent 5b1dbf2aed
commit d9c1cd4bd3

View File

@@ -833,7 +833,10 @@ string GetInfo(Song &s)
{
string result;
# ifdef HAVE_TAGLIB_H
string path_to_file = Config.mpd_music_dir + s.GetFile();
string path_to_file;
if (s.IsFromDB())
path_to_file += Config.mpd_music_dir;
path_to_file += s.GetFile();
TagLib::FileRef f(path_to_file.c_str());
if (!f.isNull())
s.SetComment(f.tag()->comment().to8Bit(UNICODE));