From f079c0ce559f8e0ac7feece3af6b1454e0690123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maty=C3=A1=C5=A1=20Bobek?= Date: Wed, 23 Mar 2022 13:16:05 +0100 Subject: [PATCH 1/2] Traktor: fix importing track key --- src/library/traktor/traktorfeature.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/library/traktor/traktorfeature.cpp b/src/library/traktor/traktorfeature.cpp index 3b7b557527d..52618d13289 100644 --- a/src/library/traktor/traktorfeature.cpp +++ b/src/library/traktor/traktorfeature.cpp @@ -16,6 +16,7 @@ #include "library/trackcollectionmanager.h" #include "library/treeitem.h" #include "moc_traktorfeature.cpp" +#include "track/keyutils.h" #include "util/sandbox.h" #include "util/semanticversion.h" @@ -360,6 +361,15 @@ void TraktorFeature::parseTrack(QXmlStreamReader &xml, QSqlQuery &query) { bpm = attr.value("BPM").toString().toFloat(); continue; } + if (xml.name() == QLatin1String("MUSICAL_KEY")) { + QXmlStreamAttributes attr = xml.attributes(); + // Traktor happens to use the same key numbering + key = KeyUtils::keyToString( + KeyUtils::keyFromNumericValue( + attr.value("VALUE").toString().toInt()), + KeyUtils::KeyNotation::Custom); + continue; + } } //We leave the infinite loop, if twe have the closing tag "ENTRY" if (xml.name() == QLatin1String("ENTRY") && xml.isEndElement()) { From a57b77e96f8ca9f1656b5a1cc689a3a72a2616db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maty=C3=A1=C5=A1=20Bobek?= Date: Wed, 6 Apr 2022 20:13:17 +0200 Subject: [PATCH 2/2] Traktor library: remove unnecessary QString copy --- src/library/traktor/traktorfeature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/library/traktor/traktorfeature.cpp b/src/library/traktor/traktorfeature.cpp index 52618d13289..c77fa045b2b 100644 --- a/src/library/traktor/traktorfeature.cpp +++ b/src/library/traktor/traktorfeature.cpp @@ -366,7 +366,7 @@ void TraktorFeature::parseTrack(QXmlStreamReader &xml, QSqlQuery &query) { // Traktor happens to use the same key numbering key = KeyUtils::keyToString( KeyUtils::keyFromNumericValue( - attr.value("VALUE").toString().toInt()), + attr.value("VALUE").toInt()), KeyUtils::KeyNotation::Custom); continue; }