[multimedia/kid3] /: Remove import from TrackType.org
Urs Fleisch
null at kde.org
Wed Feb 10 17:15:26 GMT 2021
Git commit 726c4c7a47ffe395aa536cbe78e3d88d2f0a0e15 by Urs Fleisch.
Committed on 10/02/2021 at 17:04.
Pushed by ufleisch into branch 'master'.
Remove import from TrackType.org
M +1 -1 README
M +3 -3 deb/control
M +2 -15 doc/en/index.docbook
M +1 -2 src/app/kde/kid3ui.rc
M +21 -21 src/app/org.kde.kid3.appdata.xml
M +1 -1 src/core/config/batchimportconfig.cpp
M +0 -1 src/core/import/httpclient.cpp
M +0 -1 src/plugins/freedbimport/CMakeLists.txt
M +0 -24 src/plugins/freedbimport/freedbconfig.cpp
M +0 -31 src/plugins/freedbimport/freedbconfig.h
M +1 -5 src/plugins/freedbimport/freedbimportplugin.cpp
D +0 -145 src/plugins/freedbimport/tracktypeimporter.cpp
D +0 -82 src/plugins/freedbimport/tracktypeimporter.h
https://invent.kde.org/multimedia/kid3/commit/726c4c7a47ffe395aa536cbe78e3d88d2f0a0e15
diff --git a/README b/README
index 0b5f2186..01483a6d 100644
--- a/README
+++ b/README
@@ -17,6 +17,6 @@ With Kid3 you can:
- Generate playlist files
- Automatic case conversion and string translation
- Import and export album data
-- Import from gnudb.org, TrackType.org, MusicBrainz, Discogs, Amazon
+- Import from gnudb.org, MusicBrainz, Discogs, Amazon
Kid3 uses Qt and runs under GNU/Linux (KDE or only Qt) and Windows.
diff --git a/deb/control b/deb/control
index dc0eee18..da5ce32c 100644
--- a/deb/control
+++ b/deb/control
@@ -59,7 +59,7 @@ Description: KDE audio tag editor
* Generate playlist files
* Automatic case conversion and string translation
* Import and export album data
- * Import from gnudb.org, TrackType.org, MusicBrainz, Discogs, Amazon
+ * Import from gnudb.org, MusicBrainz, Discogs, Amazon
.
This package uses KDE libraries, if you do not use KDE you should use kid3-qt.
@@ -85,7 +85,7 @@ Description: Audio tag editor
* Generate playlist files
* Automatic case conversion and string translation
* Import and export album data
- * Import from gnudb.org, TrackType.org, MusicBrainz, Discogs, Amazon
+ * Import from gnudb.org, MusicBrainz, Discogs, Amazon
.
This package does not use KDE libraries, if you use KDE you should use kid3.
@@ -112,7 +112,7 @@ Description: Command line audio tag editor
* Generate playlist files
* Automatic case conversion and string translation
* Import and export album data
- * Import from gnudb.org, TrackType.org, MusicBrainz, Discogs, Amazon
+ * Import from gnudb.org, MusicBrainz, Discogs, Amazon
.
This package contains a command line interface for Kid3, for a GUI you can
use kid3-qt or kid3.
diff --git a/doc/en/index.docbook b/doc/en/index.docbook
index af411d96..70d06231 100644
--- a/doc/en/index.docbook
+++ b/doc/en/index.docbook
@@ -234,7 +234,6 @@ to use a consistent naming scheme in all tags.
<para>
The tag information for full albums can be taken from
<ulink url="http://gnudb.org">gnudb.org</ulink>, <ulink
-url="http://tracktype.org">TrackType.org</ulink>, <ulink
url="http://musicbrainz.org">MusicBrainz</ulink>, <ulink
url="http://discogs.com">Discogs</ulink>, <ulink
url="http://www.amazon.com">Amazon</ulink> or other sources of
@@ -264,7 +263,6 @@ TrueAudio, WavPack, WMA, WAV and AIFF tags</para></listitem>
<listitem><para>Generate playlist file</para></listitem>
<listitem><para>Automatic case conversion and string translation</para></listitem>
<listitem><para>Import from <ulink url="http://gnudb.org">gnudb.org</ulink>,
-<ulink url="http://tracktype.org">TrackType.org</ulink>,
<ulink url="http://musicbrainz.org">MusicBrainz</ulink>,
<ulink url="http://discogs.com">Discogs</ulink>,
<ulink url="http://www.amazon.com">Amazon</ulink>
@@ -1095,7 +1093,7 @@ Discogs, Amazon or other sources of album track lists in textual format.
<para id="import-freedb">
Import from a freedb.org server is possible using a dialog which appears when
<guibutton>From Server:</guibutton>
-<guibutton>gnudb.org</guibutton> or <guibutton>TrackType.org</guibutton>
+<guibutton>gnudb.org</guibutton>
is selected. The artist and album name
to search for can be entered in the two topmost fields,
the albums which match the
@@ -1333,17 +1331,6 @@ opens directly the <guibutton>gnudb.org</guibutton>
dialog.</para></listitem>
</varlistentry>
-<varlistentry>
-<term><menuchoice>
-<guimenu>File</guimenu>
-<guimenuitem>Import from TrackType.org...</guimenuitem>
-</menuchoice></term>
-<listitem><para><action>Import from the TrackType.org server.</action> This menu
-item opens the same import dialog as <guimenuitem>Import...</guimenuitem>, but
-opens directly the <guibutton>TrackType.org</guibutton>
-dialog.</para></listitem>
-</varlistentry>
-
<varlistentry>
<term><menuchoice>
<guimenu>File</guimenu>
@@ -2572,7 +2559,7 @@ Used for the <guimenuitem>Import from Discogs...</guimenuitem> function.
</para></listitem>
<listitem><para><guilabel>FreedbImport</guilabel>:
Used for the <guimenuitem>Import from gnudb.org...</guimenuitem>
-and <guimenuitem>Import from TrackType.org...</guimenuitem> functions.
+function.
</para></listitem>
<listitem><para><guilabel>MusicBrainzImport</guilabel>:
Used for the <guimenuitem>Import from MusicBrainz Release...</guimenuitem>
diff --git a/src/app/kde/kid3ui.rc b/src/app/kde/kid3ui.rc
index 09429c5b..cb7ef862 100644
--- a/src/app/kde/kid3ui.rc
+++ b/src/app/kde/kid3ui.rc
@@ -1,5 +1,5 @@
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<kpartgui name="kid3" version="18">
+<kpartgui name="kid3" version="19">
<MenuBar>
<Menu name="file" noMerge="1"><text>&File</text>
<Action name="file_open"/>
@@ -14,7 +14,6 @@
<Action name="import_amazon"/>
<Action name="import_discogs"/>
<Action name="import_gnudb"/>
- <Action name="import_tracktype"/>
<Action name="import_musicbrainzrelease"/>
<Action name="import_musicbrainzfingerprint"/>
<Action name="import_tags"/>
diff --git a/src/app/org.kde.kid3.appdata.xml b/src/app/org.kde.kid3.appdata.xml
index 5a4daf4c..7c287b3d 100644
--- a/src/app/org.kde.kid3.appdata.xml
+++ b/src/app/org.kde.kid3.appdata.xml
@@ -139,30 +139,30 @@
<p xml:lang="uk">Передбачено можливість встановлювати мітки для цілих наборів файлів. Передбачено можливість створювати мітки на основі назв файлів або вмісту інших полів міток і створювати назви файлів на основі міток і перейменовувати теки на основі міток. Автоматичне перетворення регістру символів та заміна рядків допоможуть вам у підтриманні однорідності міток у вашій збірці.</p>
<p xml:lang="x-test">xxThe tags of multiple files can be set together. It is possible to generate tags from file names or the contents of other tag fields and to generate file names from tags and rename folders from tags. Automatic case conversion and string replacement help to keep tags consistent.xx</p>
<p>
- Album data can be imported from gnudb.org, TrackType.org, MusicBrainz,
+ Album data can be imported from gnudb.org, MusicBrainz,
Discogs, Amazon; automatic batch import is available for multiple
folders. It is also possible to export data and generate play lists.
</p>
- <p xml:lang="ca">Les dades de l'àlbum es poden importar des de gnudb.org, TrackType.org, MusicBrainz, Discogs, Amazon. Hi ha disponible la importació automàtica per lots per a múltiples carpetes. També és possible exportar dades i generar llistes de reproducció.</p>
- <p xml:lang="ca-valencia">Les dades de l'àlbum es poden importar des de gnudb.org, TrackType.org, MusicBrainz, Discogs, Amazon. Hi ha disponible la importació automàtica per lots per a múltiples carpetes. També és possible exportar dades i generar llistes de reproducció.</p>
- <p xml:lang="da">Albumdata kan importeres fra gnudb.org, TrackType.org, MusicBrainz, Discogs, Amazon. Automatisk batch-import er tilgængelig ved flere mapper. Det er også muligt at eksportere data og generere spillelister.</p>
- <p xml:lang="el">Δεδομένα για άλμπουμ μπορούν να εισαχθούν από τα gnudb.org, TrackType.org, MusicBrainz, Discogs, Amazon. Αυτόματη εισαγωγή δέσμης είναι διαθέσιμη για πολλούς φακέλους. Είναι επίσης δυνατή η εξαγωγή δεδομένων και η δημιουργία λιστών αναπαραγωγής.</p>
- <p xml:lang="en-GB">Album data can be imported from gnudb.org, TrackType.org, MusicBrainz, Discogs, Amazon; automatic batch import is available for multiple folders. It is also possible to export data and generate play lists.</p>
- <p xml:lang="es">Puede importar datos de álbumes de gnudb.org, TrackType.org, MusicBrainz, Discogs y Amazon. Puede realizar importaciones automáticas por lotes para múltiples carpetas. También puede exportar datos y generar listas de reproducción.</p>
- <p xml:lang="et">Albumi andmeid saab importida järgmistest asukohtadest: gnudb.org, TrackType.org, MusicBrainz, Discogs, Amazon. Automaatne hulgiimport võimaldab täita mitut kataloogi korraga. Samuti saab andmeid eksportida ja luua esitusloendeid.</p>
- <p xml:lang="fi">Albumin tiedot voi tuoda gnudb.orgista, TrackType.orgista, MusicBrainzistä, Discogsista ja Amazonista. Useamman kansion automaattinen eräajotuonti on mahdollista. Tiedot voi myös viedä ja luoda soittolistan.</p>
- <p xml:lang="fr">Les informations des albums peuvent être importées de gnudb.org, TrackType.org, MusicBrainz, Discogs et Amazon. Un import automatique sur plusieurs dossiers en même temps est disponible. Il est aussi possible d'exporter les données et de générer des playlists.</p>
- <p xml:lang="id">Data album bisa diimpor dari gnudb.org, TrackType.org, MusicBrainz, Discogs, Amazon; impor batch otomatis tersedia untuk beberapa folder. Yang memungkinkan juga untuk mengekspor data dan menghasilkan daftar putar.</p>
- <p xml:lang="it">È possibile importare i dati dell'album da gnudb.org, TrackType.org, MusicBrainz, Discogs, Amazon; è disponibile l'importazione automatica in serie per più cartelle. È inoltre possibile esportare i dati e generare scalette.</p>
- <p xml:lang="ko">gnudb.org, TrackType.org, MusicBrainz, Discogs, Amazon에서 앨범 데이터를 가져올 수 있습니다. 여러 폴더에서 자동으로 일괄적 가져오기를 수행할 수 있습니다. 데이터를 내보내고 재생 목록을 생성할 수 있습니다.</p>
- <p xml:lang="nl">Albumgegevens kunnen geïmporteerd worden uit gnudb.org, TrackType.org, MusicBrainz, Discogs, Amazon; automatische bulkimport is beschikbaar voor meerdere mappen. Het is ook mogelijk gegevens te exporteren en afspeellijsten te genereren.</p>
- <p xml:lang="pt">Os dados dos álbuns podem ser importados a partir do gnudb.org, TrackType.org, MusicBrainz, Discogs, Amazon; está disponível a importação automática em lote para várias pastas. Também é possível exportar os dados e gerar listas de reprodução.</p>
- <p xml:lang="pt-BR">Os dados de álbuns podem ser importados de gnudb.org, TrackType.org, MusicBrainz, Discogs, Amazon; a importação em lotes está disponível para múltiplas pastas. Também é possível exportar dados e gerar listas de reprodução.</p>
- <p xml:lang="sk">Dáta albumu je možné importovať z gnudb.org, TrackType.org, MusicBrainz, Discogs, Amazon; automatický dávkový import je k dispozícii pre viac priečinkov.Je tiež možné exportovať údaje a vytvárať zoznamy skladieb.</p>
- <p xml:lang="sl">Podatke o albumu lahko uvozite iz gnudb.org, TrackType.org, MusicBrainz, Discogs, Amazon; samodejni uvoz paketov je na voljo za več map.Možen je tudi izvoz podatkov in ustvarjanje seznamov predvajanja.</p>
- <p xml:lang="sv">Albumdata kan importeras från gnudb.org, TrackType.org, MusicBrainz, Discogs, eller Amazon. Automatisk import i bakgrunden är tillgänglig för flera kataloger. Det är också möjligt att exportera data och skapa spellistor.</p>
- <p xml:lang="uk">Передбачено можливість імпортування даних альбомів з gnudb.org, TrackType.org, MusicBrainz, Discogs, Amazon. Можливе автоматичне пакетне імпортування для декількох тек одночасно. Передбачено можливість експортування даних та створення списків відтворення.</p>
- <p xml:lang="x-test">xxAlbum data can be imported from gnudb.org, TrackType.org, MusicBrainz, Discogs, Amazon; automatic batch import is available for multiple folders. It is also possible to export data and generate play lists.xx</p>
+ <p xml:lang="ca">Les dades de l'àlbum es poden importar des de gnudb.org, MusicBrainz, Discogs, Amazon. Hi ha disponible la importació automàtica per lots per a múltiples carpetes. També és possible exportar dades i generar llistes de reproducció.</p>
+ <p xml:lang="ca-valencia">Les dades de l'àlbum es poden importar des de gnudb.org, MusicBrainz, Discogs, Amazon. Hi ha disponible la importació automàtica per lots per a múltiples carpetes. També és possible exportar dades i generar llistes de reproducció.</p>
+ <p xml:lang="da">Albumdata kan importeres fra gnudb.org, MusicBrainz, Discogs, Amazon. Automatisk batch-import er tilgængelig ved flere mapper. Det er også muligt at eksportere data og generere spillelister.</p>
+ <p xml:lang="el">Δεδομένα για άλμπουμ μπορούν να εισαχθούν από τα gnudb.org, MusicBrainz, Discogs, Amazon. Αυτόματη εισαγωγή δέσμης είναι διαθέσιμη για πολλούς φακέλους. Είναι επίσης δυνατή η εξαγωγή δεδομένων και η δημιουργία λιστών αναπαραγωγής.</p>
+ <p xml:lang="en-GB">Album data can be imported from gnudb.org, MusicBrainz, Discogs, Amazon; automatic batch import is available for multiple folders. It is also possible to export data and generate play lists.</p>
+ <p xml:lang="es">Puede importar datos de álbumes de gnudb.org, MusicBrainz, Discogs y Amazon. Puede realizar importaciones automáticas por lotes para múltiples carpetas. También puede exportar datos y generar listas de reproducción.</p>
+ <p xml:lang="et">Albumi andmeid saab importida järgmistest asukohtadest: gnudb.org, MusicBrainz, Discogs, Amazon. Automaatne hulgiimport võimaldab täita mitut kataloogi korraga. Samuti saab andmeid eksportida ja luua esitusloendeid.</p>
+ <p xml:lang="fi">Albumin tiedot voi tuoda gnudb.orgista, MusicBrainzistä, Discogsista ja Amazonista. Useamman kansion automaattinen eräajotuonti on mahdollista. Tiedot voi myös viedä ja luoda soittolistan.</p>
+ <p xml:lang="fr">Les informations des albums peuvent être importées de gnudb.org, MusicBrainz, Discogs et Amazon. Un import automatique sur plusieurs dossiers en même temps est disponible. Il est aussi possible d'exporter les données et de générer des playlists.</p>
+ <p xml:lang="id">Data album bisa diimpor dari gnudb.org, MusicBrainz, Discogs, Amazon; impor batch otomatis tersedia untuk beberapa folder. Yang memungkinkan juga untuk mengekspor data dan menghasilkan daftar putar.</p>
+ <p xml:lang="it">È possibile importare i dati dell'album da gnudb.org, MusicBrainz, Discogs, Amazon; è disponibile l'importazione automatica in serie per più cartelle. È inoltre possibile esportare i dati e generare scalette.</p>
+ <p xml:lang="ko">gnudb.org, MusicBrainz, Discogs, Amazon에서 앨범 데이터를 가져올 수 있습니다. 여러 폴더에서 자동으로 일괄적 가져오기를 수행할 수 있습니다. 데이터를 내보내고 재생 목록을 생성할 수 있습니다.</p>
+ <p xml:lang="nl">Albumgegevens kunnen geïmporteerd worden uit gnudb.org, MusicBrainz, Discogs, Amazon; automatische bulkimport is beschikbaar voor meerdere mappen. Het is ook mogelijk gegevens te exporteren en afspeellijsten te genereren.</p>
+ <p xml:lang="pt">Os dados dos álbuns podem ser importados a partir do gnudb.org, MusicBrainz, Discogs, Amazon; está disponível a importação automática em lote para várias pastas. Também é possível exportar os dados e gerar listas de reprodução.</p>
+ <p xml:lang="pt-BR">Os dados de álbuns podem ser importados de gnudb.org, MusicBrainz, Discogs, Amazon; a importação em lotes está disponível para múltiplas pastas. Também é possível exportar dados e gerar listas de reprodução.</p>
+ <p xml:lang="sk">Dáta albumu je možné importovať z gnudb.org, MusicBrainz, Discogs, Amazon; automatický dávkový import je k dispozícii pre viac priečinkov.Je tiež možné exportovať údaje a vytvárať zoznamy skladieb.</p>
+ <p xml:lang="sl">Podatke o albumu lahko uvozite iz gnudb.org, MusicBrainz, Discogs, Amazon; samodejni uvoz paketov je na voljo za več map.Možen je tudi izvoz podatkov in ustvarjanje seznamov predvajanja.</p>
+ <p xml:lang="sv">Albumdata kan importeras från gnudb.org, MusicBrainz, Discogs, eller Amazon. Automatisk import i bakgrunden är tillgänglig för flera kataloger. Det är också möjligt att exportera data och skapa spellistor.</p>
+ <p xml:lang="uk">Передбачено можливість імпортування даних альбомів з gnudb.org, MusicBrainz, Discogs, Amazon. Можливе автоматичне пакетне імпортування для декількох тек одночасно. Передбачено можливість експортування даних та створення списків відтворення.</p>
+ <p xml:lang="x-test">xxAlbum data can be imported from gnudb.org, MusicBrainz, Discogs, Amazon; automatic batch import is available for multiple folders. It is also possible to export data and generate play lists.xx</p>
</description>
<screenshots>
<screenshot type="default" width="1200" height="675">
diff --git a/src/core/config/batchimportconfig.cpp b/src/core/config/batchimportconfig.cpp
index a6d52672..95aaedc5 100644
--- a/src/core/config/batchimportconfig.cpp
+++ b/src/core/config/batchimportconfig.cpp
@@ -50,7 +50,7 @@ BatchImportConfig::BatchImportConfig()
QLatin1String("Custom Profile");
m_profileSources <<
QLatin1String("MusicBrainz Release:75:SAC;Discogs:75:SAC;Amazon:75:SAC;"
- "gnudb.org:75:S;TrackType.org:75:S") <<
+ "gnudb.org:75:S") <<
QLatin1String("MusicBrainz Release:75:SAC") <<
QLatin1String("Discogs:75:SAC") <<
QLatin1String("Amazon:75:C;Discogs:75:C;MusicBrainz Release:75:C") <<
diff --git a/src/core/import/httpclient.cpp b/src/core/import/httpclient.cpp
index 3c28dd4e..baa9096f 100644
--- a/src/core/import/httpclient.cpp
+++ b/src/core/import/httpclient.cpp
@@ -57,7 +57,6 @@ static struct MinimumRequestIntervalInitializer {
HttpClient::s_minimumRequestInterval[QLatin1String("images.amazon.com")] = 1000;
HttpClient::s_minimumRequestInterval[QLatin1String("www.gnudb.org")] = 1000;
HttpClient::s_minimumRequestInterval[QLatin1String("gnudb.gnudb.org")] = 1000;
- HttpClient::s_minimumRequestInterval[QLatin1String("tracktype.org")] = 1000;
HttpClient::s_minimumRequestInterval[QLatin1String("api.acoustid.org")] = 1000;
}
} minimumRequestIntervalInitializer;
diff --git a/src/plugins/freedbimport/CMakeLists.txt b/src/plugins/freedbimport/CMakeLists.txt
index f6482397..aa7ae20e 100644
--- a/src/plugins/freedbimport/CMakeLists.txt
+++ b/src/plugins/freedbimport/CMakeLists.txt
@@ -10,7 +10,6 @@ qt5_wrap_cpp(plugin_GEN_MOC_SRCS
add_library(${plugin_TARGET}
freedbimportplugin.cpp
freedbimporter.cpp
- tracktypeimporter.cpp
freedbconfig.cpp
${plugin_GEN_MOC_SRCS}
)
diff --git a/src/plugins/freedbimport/freedbconfig.cpp b/src/plugins/freedbimport/freedbconfig.cpp
index 4a88872c..0b2f0609 100644
--- a/src/plugins/freedbimport/freedbconfig.cpp
+++ b/src/plugins/freedbimport/freedbconfig.cpp
@@ -53,27 +53,3 @@ void FreedbConfig::readFromConfig(ISettings* config)
setServer(QLatin1String("www.gnudb.org:80")); // replace old default
}
}
-
-
-int TrackTypeConfig::s_index = -1;
-
-/**
- * Constructor.
- */
-TrackTypeConfig::TrackTypeConfig()
- : StoredConfig<TrackTypeConfig, FreedbConfig>(QLatin1String("TrackType"))
-{
-}
-
-/**
- * Read persisted configuration.
- *
- * @param config KDE configuration
- */
-void TrackTypeConfig::readFromConfig(ISettings* config)
-{
- ServerImporterConfig::readFromConfig(config); // clazy:exclude=skipped-base-method
- if (server() == QLatin1String("gnudb.gnudb.org:80")) {
- setServer(QLatin1String("tracktype.org:80")); // replace default
- }
-}
diff --git a/src/plugins/freedbimport/freedbconfig.h b/src/plugins/freedbimport/freedbconfig.h
index 16f9ca34..64423119 100644
--- a/src/plugins/freedbimport/freedbconfig.h
+++ b/src/plugins/freedbimport/freedbconfig.h
@@ -60,34 +60,3 @@ private:
/** Index in configuration storage */
static int s_index;
};
-
-
-/**
- * FreedbConfig subclass for stored TrackType configuration instance.
- */
-class TrackTypeConfig : public StoredConfig<TrackTypeConfig, FreedbConfig> {
-public:
- /**
- * Constructor.
- */
- TrackTypeConfig();
-
- /**
- * Destructor.
- */
- virtual ~TrackTypeConfig() override = default;
-
- /**
- * Read persisted configuration.
- *
- * @param config KDE configuration
- */
- virtual void readFromConfig(ISettings* config) override;
-
-private:
- friend TrackTypeConfig&
- StoredConfig<TrackTypeConfig, FreedbConfig>::instance();
-
- /** Index in configuration storage */
- static int s_index;
-};
diff --git a/src/plugins/freedbimport/freedbimportplugin.cpp b/src/plugins/freedbimport/freedbimportplugin.cpp
index b014e65d..c8238791 100644
--- a/src/plugins/freedbimport/freedbimportplugin.cpp
+++ b/src/plugins/freedbimport/freedbimportplugin.cpp
@@ -26,12 +26,10 @@
#include "freedbimportplugin.h"
#include "freedbimporter.h"
-#include "tracktypeimporter.h"
namespace {
const QLatin1String FREEDB_IMPORTER_NAME("FreedbImport");
-const QLatin1String TRACKTYPE_IMPORTER_NAME("TrackTypeImport");
}
@@ -50,7 +48,7 @@ FreedbImportPlugin::FreedbImportPlugin(QObject* parent) : QObject(parent)
*/
QStringList FreedbImportPlugin::serverImporterKeys() const
{
- return {FREEDB_IMPORTER_NAME, TRACKTYPE_IMPORTER_NAME};
+ return {FREEDB_IMPORTER_NAME};
}
/**
@@ -67,8 +65,6 @@ ServerImporter* FreedbImportPlugin::createServerImporter(
{
if (key == FREEDB_IMPORTER_NAME) {
return new FreedbImporter(netMgr, trackDataModel);
- } else if (key == TRACKTYPE_IMPORTER_NAME) {
- return new TrackTypeImporter(netMgr, trackDataModel);
}
return nullptr;
}
diff --git a/src/plugins/freedbimport/tracktypeimporter.cpp b/src/plugins/freedbimport/tracktypeimporter.cpp
deleted file mode 100644
index e3f783fe..00000000
--- a/src/plugins/freedbimport/tracktypeimporter.cpp
+++ /dev/null
@@ -1,145 +0,0 @@
-/**
- * \file tracktypeimporter.cpp
- * TrackType.org importer.
- *
- * \b Project: Kid3
- * \author Urs Fleisch
- * \date 26 Apr 2007
- *
- * Copyright (C) 2007-2018 Urs Fleisch
- *
- * This file is part of Kid3.
- *
- * Kid3 is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * Kid3 is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "tracktypeimporter.h"
-#include <QRegularExpression>
-#include "serverimporterconfig.h"
-#include "freedbconfig.h"
-#include "config.h"
-
-namespace {
-
-const char trackTypeServer[] = "tracktype.org:80";
-
-}
-
-/**
- * Constructor.
- *
- * @param netMgr network access manager
- * @param trackDataModel track data to be filled with imported values
- */
-TrackTypeImporter::TrackTypeImporter(QNetworkAccessManager* netMgr,
- TrackDataModel *trackDataModel)
- : FreedbImporter(netMgr, trackDataModel)
-{
- setObjectName(QLatin1String("TrackTypeImporter"));
-}
-
-/**
- * Name of import source.
- * @return name.
- */
-const char* TrackTypeImporter::name() const {
- return QT_TRANSLATE_NOOP("@default", "TrackType.org");
-}
-
-/** NULL-terminated array of server strings, 0 if not used */
-const char** TrackTypeImporter::serverList() const
-{
- static const char* servers[] = {
- "tracktype.org:80",
- nullptr // end of StrList
- };
- return servers;
-}
-
-/** default server, 0 to disable */
-const char* TrackTypeImporter::defaultServer() const { return "tracktype.org:80"; }
-
-/** configuration, 0 if not used */
-ServerImporterConfig* TrackTypeImporter::config() const { return &TrackTypeConfig::instance(); }
-
-/**
- * Process finished findCddbAlbum request.
- *
- * @param searchStr search data received
- */
-void TrackTypeImporter::parseFindResults(const QByteArray& searchStr)
-{
-/*
-210 exact matches found
-categ discid dtitle
-(more matches...)
-.
-or
-211 close matches found
-rock 920b810c Catharsis / Imago
-.
-theoretically, but never seen
-200 categ discid dtitle
-*/
- QString str = QString::fromUtf8(searchStr);
- QRegularExpression catIdTitleRe(QLatin1String("^([a-z]+)\\s+([0-9a-f]+)\\s+([^/]+ / .+)$"));
- QStringList lines = str.split(QRegularExpression(QLatin1String("[\\r\\n]+")));
- bool inEntries = false;
- m_albumListModel->clear();
- for (auto it = lines.constBegin(); it != lines.constEnd(); ++it) {
- if (*it == QLatin1String(".")) {
- break;
- }
- if (inEntries) {
- auto match = catIdTitleRe.match(*it);
- if (match.hasMatch()) {
- m_albumListModel->appendItem(
- match.captured(3),
- match.captured(1),
- match.captured(2));
- }
- } else {
- if ((*it).startsWith(QLatin1String("21")) && (*it).indexOf(QLatin1String(" match")) != -1) {
- inEntries = true;
- } else if ((*it).startsWith(QLatin1String("200 "))) {
- auto match = catIdTitleRe.match((*it).mid(4));
- if (match.hasMatch()) {
- m_albumListModel->appendItem(
- match.captured(3),
- match.captured(1),
- match.captured(2));
- }
- }
- }
- }
-}
-
-/**
- * Send a query command to search on the server.
- *
- * @param cfg import source configuration
- * @param artist artist to search
- * @param album album to search
- */
-void TrackTypeImporter::sendFindQuery(
- const ServerImporterConfig* cfg,
- const QString& artist, const QString& album)
-{
- // At the moment, only TrackType.org recognizes cddb album commands,
- // so we always use this server for find queries.
- sendRequest(QString::fromLatin1(trackTypeServer),
- cfg->cgiPath() + QLatin1String("?cmd=cddb+album+") +
- encodeUrlQuery(artist + QLatin1String(" / ") + album) +
- QLatin1String("&hello=noname+localhost+Kid3+" VERSION "&proto=6"));
-}
diff --git a/src/plugins/freedbimport/tracktypeimporter.h b/src/plugins/freedbimport/tracktypeimporter.h
deleted file mode 100644
index df62d4dd..00000000
--- a/src/plugins/freedbimport/tracktypeimporter.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * \file tracktypeimporter.h
- * TrackType.org importer.
- *
- * \b Project: Kid3
- * \author Urs Fleisch
- * \date 26 Apr 2007
- *
- * Copyright (C) 2007-2018 Urs Fleisch
- *
- * This file is part of Kid3.
- *
- * Kid3 is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * Kid3 is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#pragma once
-
-#include "freedbimporter.h"
-
-/**
- * TrackType.org importer.
- */
-class TrackTypeImporter : public FreedbImporter {
-public:
- /**
- * Constructor.
- *
- * @param netMgr network access manager
- * @param trackDataModel track data to be filled with imported values
- */
- TrackTypeImporter(QNetworkAccessManager* netMgr,
- TrackDataModel *trackDataModel);
-
- /**
- * Destructor.
- */
- virtual ~TrackTypeImporter() override = default;
-
- /**
- * Name of import source.
- * @return name.
- */
- virtual const char* name() const override;
-
- /** NULL-terminated array of server strings, 0 if not used */
- virtual const char** serverList() const override;
-
- /** default server, 0 to disable */
- virtual const char* defaultServer() const override;
-
- /** configuration, 0 if not used */
- virtual ServerImporterConfig* config() const override;
-
- /**
- * Process finished findCddbAlbum request.
- *
- * @param searchStr search data received
- */
- virtual void parseFindResults(const QByteArray& searchStr) override;
-
- /**
- * Send a query command to search on the server.
- *
- * @param cfg import source configuration
- * @param artist artist to search
- * @param album album to search
- */
- virtual void sendFindQuery(
- const ServerImporterConfig* cfg,
- const QString& artist, const QString& album) override;
-};
More information about the kde-doc-english
mailing list