song: shortening of length string by chopping off the tail (12:34->12:3)

This commit is contained in:
Daniel
2012-11-15 12:44:15 +01:00
committed by Andrzej Rybczak
parent 1e1aba121d
commit a6c843569a

View File

@@ -366,7 +366,13 @@ std::string Song::ParseFormat(std::string::const_iterator &it, const std::string
if (!tag.empty() && (get_fun != &MPD::Song::getLength || getDuration() > 0))
{
if (delimiter && tag.size() > delimiter)
tag = ToString(wideShorten(ToWString(tag), delimiter));
{
// Shorten length string by just chopping off the tail
if (get_fun == &MPD::Song::getLength)
tag = tag.substr(0, delimiter);
else
tag = ToString(wideShorten(ToWString(tag), delimiter));
}
has_some_tags = 1;
result += tag;
}