From a6c843569ad0eb47d3d43a6508cda05aa04f597a Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 15 Nov 2012 12:44:15 +0100 Subject: [PATCH] song: shortening of length string by chopping off the tail (12:34->12:3) --- src/song.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/song.cpp b/src/song.cpp index cbbbd765..a16da18d 100644 --- a/src/song.cpp +++ b/src/song.cpp @@ -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; }