Create common class for Musixmatch
This commit is contained in:
@@ -39,9 +39,7 @@
|
||||
#include "jsonlyricsprovider.h"
|
||||
#include "lyricsfetcher.h"
|
||||
#include "musixmatchlyricsprovider.h"
|
||||
|
||||
const char *MusixmatchLyricsProvider::kApiUrl = "https://api.musixmatch.com/ws/1.1";
|
||||
const char *MusixmatchLyricsProvider::kApiKey = "Y2FhMDRlN2Y4OWE5OTIxYmZlOGMzOWQzOGI3ZGU4MjE=";
|
||||
#include "providers/musixmatchprovider.h"
|
||||
|
||||
MusixmatchLyricsProvider::MusixmatchLyricsProvider(NetworkAccessManager *network, QObject *parent) : JsonLyricsProvider("Musixmatch", true, false, network, parent), rate_limit_exceeded_(false) {}
|
||||
|
||||
@@ -247,18 +245,6 @@ void MusixmatchLyricsProvider::HandleSearchReply(QNetworkReply *reply, LyricsSea
|
||||
|
||||
}
|
||||
|
||||
QString MusixmatchLyricsProvider::StringFixup(QString string) {
|
||||
|
||||
return string.replace('/', '-')
|
||||
.replace('\'', '-')
|
||||
.remove(QRegularExpression("[^\\w0-9\\- ]", QRegularExpression::UseUnicodePropertiesOption))
|
||||
.simplified()
|
||||
.replace(' ', '-')
|
||||
.replace(QRegularExpression("(-)\\1+"), "-")
|
||||
.toLower();
|
||||
|
||||
}
|
||||
|
||||
bool MusixmatchLyricsProvider::CreateLyricsRequest(LyricsSearchContextPtr search) {
|
||||
|
||||
QString artist_stripped = StringFixup(search->artist);
|
||||
|
||||
Reference in New Issue
Block a user