aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/qmmp/fileinfo.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/qmmp/fileinfo.cpp b/src/qmmp/fileinfo.cpp
index 61e3f545c..3ef4e185a 100644
--- a/src/qmmp/fileinfo.cpp
+++ b/src/qmmp/fileinfo.cpp
@@ -98,7 +98,15 @@ void FileInfo::setLength(qint64 length)
void FileInfo::setMetaData(Qmmp::MetaData key, const QString &value)
{
- if (!value.isEmpty() && value != "0")
+ if (value.isEmpty() || value == "0")
+ return;
+
+ //extract track number from "Track Number/Total Tracks Number" string
+ if((key == Qmmp::TRACK || key == Qmmp::DISCNUMBER) && value.contains("/"))
+ {
+ m_metaData.insert(key, value.section("/",0,0));
+ }
+ else
m_metaData.insert(key, value);
}