From 52c83d592c931ca4fd8b30bd123c67bcc3b9293a Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Wed, 22 Mar 2023 23:36:15 +0100 Subject: [PATCH] Rename Stands4 to Lyrics.com --- README.md | 2 +- debian/control.in | 2 +- ...rawberrymusicplayer.strawberry.appdata.xml | 2 +- dist/unix/strawberry.1 | 2 +- dist/unix/strawberry.spec.in | 2 +- src/CMakeLists.txt | 4 +- src/core/application.cpp | 4 +- ...ovider.cpp => lyricscomlyricsprovider.cpp} | 60 +++++++++---------- ...csprovider.h => lyricscomlyricsprovider.h} | 12 ++-- 9 files changed, 45 insertions(+), 45 deletions(-) rename src/lyrics/{stands4lyricsprovider.cpp => lyricscomlyricsprovider.cpp} (72%) rename src/lyrics/{stands4lyricsprovider.h => lyricscomlyricsprovider.h} (87%) diff --git a/README.md b/README.md index 05f83181..f4201e07 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Funding developers is a way to contribute to open source projects you appreciate * Edit tags on audio files * Fetch tags from MusicBrainz * Album cover art from [Last.fm](https://www.last.fm/), [Musicbrainz](https://musicbrainz.org/), [Discogs](https://www.discogs.com/), [Musixmatch](https://www.musixmatch.com/), [Deezer](https://www.deezer.com/), [Tidal](https://www.tidal.com/), [Qobuz](https://www.qobuz.com/) and [Spotify](https://www.spotify.com/) - * Song lyrics from [STANDS4](https://www.lyrics.com/), [Genius](https://genius.com/), [Musixmatch](https://www.musixmatch.com/), [ChartLyrics](http://www.chartlyrics.com/), [lyrics.ovh](https://lyrics.ovh/) and [lololyrics.com](https://www.lololyrics.com/) + * Song lyrics from [Lyrics.com](https://www.lyrics.com/), [Genius](https://genius.com/), [Musixmatch](https://www.musixmatch.com/), [ChartLyrics](http://www.chartlyrics.com/), [lyrics.ovh](https://lyrics.ovh/) and [lololyrics.com](https://www.lololyrics.com/) * Support for multiple backends * Audio analyzer * Audio equalizer diff --git a/debian/control.in b/debian/control.in index 30deb119..296d3597 100644 --- a/debian/control.in +++ b/debian/control.in @@ -52,7 +52,7 @@ Description: music player and music collection organizer - Edit tags on audio files - Automatically retrieve tags from MusicBrainz - Album cover art from Last.fm, Musicbrainz, Discogs, Musixmatch, Deezer, Tidal, Qobuz and Spotify - - Song lyrics from STANDS4, Genius, Musixmatch, ChartLyrics, lyrics.ovh and lololyrics.com + - Song lyrics from Lyrics.com, Genius, Musixmatch, ChartLyrics, lyrics.ovh and lololyrics.com - Audio analyzer - Audio equalizer - Transfer music to mass-storage USB players, MTP compatible devices and iPod Nano/Classic diff --git a/dist/unix/org.strawberrymusicplayer.strawberry.appdata.xml b/dist/unix/org.strawberrymusicplayer.strawberry.appdata.xml index 1ce9a25d..082d48d8 100644 --- a/dist/unix/org.strawberrymusicplayer.strawberry.appdata.xml +++ b/dist/unix/org.strawberrymusicplayer.strawberry.appdata.xml @@ -29,7 +29,7 @@
  • Edit tags on audio files
  • Automatically retrieve tags from MusicBrainz
  • Album cover art from Last.fm, Musicbrainz, Discogs, Musixmatch, Deezer, Tidal, Qobuz and Spotify
  • -
  • Song lyrics from STANDS4, Genius, Musixmatch, ChartLyrics, lyrics.ovh and lololyrics.com
  • +
  • Song lyrics from Lyrics.com, Genius, Musixmatch, ChartLyrics, lyrics.ovh and lololyrics.com
  • Support for multiple backends
  • Audio analyzer and equalizer
  • Transfer music to mass-storage USB players, MTP compatible devices and iPod Nano/Classic
  • diff --git a/dist/unix/strawberry.1 b/dist/unix/strawberry.1 index 5b1bd8a6..c7cc71a5 100644 --- a/dist/unix/strawberry.1 +++ b/dist/unix/strawberry.1 @@ -29,7 +29,7 @@ Features: .br - Album cover art from Last.fm, Musicbrainz, Discogs, Musixmatch, Deezer, Tidal, Qobuz and Spotify .br -- Song lyrics from STANDS4, Genius, Musixmatch, ChartLyrics, lyrics.ovh and lololyrics.com +- Song lyrics from Lyrics.com, Genius, Musixmatch, ChartLyrics, lyrics.ovh and lololyrics.com .br - Support for multiple backends .br diff --git a/dist/unix/strawberry.spec.in b/dist/unix/strawberry.spec.in index 9b0fe661..e0c9003e 100644 --- a/dist/unix/strawberry.spec.in +++ b/dist/unix/strawberry.spec.in @@ -119,7 +119,7 @@ Features: - Edit tags on audio files - Automatically retrieve tags from MusicBrainz - Album cover art from Last.fm, Musicbrainz, Discogs, Musixmatch, Deezer, Tidal, Qobuz and Spotify - - Song lyrics from STANDS4, Genius, Musixmatch, ChartLyrics, lyrics.ovh and lololyrics.com + - Song lyrics from Lyrics.com, Genius, Musixmatch, ChartLyrics, lyrics.ovh and lololyrics.com - Support for multiple backends - Audio analyzer - Audio equalizer diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 310c4291..016b2b46 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -179,7 +179,7 @@ set(SOURCES lyrics/geniuslyricsprovider.cpp lyrics/musixmatchlyricsprovider.cpp lyrics/chartlyricsprovider.cpp - lyrics/stands4lyricsprovider.cpp + lyrics/lyricscomlyricsprovider.cpp providers/musixmatchprovider.cpp @@ -415,7 +415,7 @@ set(HEADERS lyrics/geniuslyricsprovider.h lyrics/musixmatchlyricsprovider.h lyrics/chartlyricsprovider.h - lyrics/stands4lyricsprovider.h + lyrics/lyricscomlyricsprovider.h settings/settingsdialog.h settings/settingspage.h diff --git a/src/core/application.cpp b/src/core/application.cpp index 35b8fd3a..2f92c378 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -62,7 +62,7 @@ #include "lyrics/lololyricsprovider.h" #include "lyrics/musixmatchlyricsprovider.h" #include "lyrics/chartlyricsprovider.h" -#include "lyrics/stands4lyricsprovider.h" +#include "lyrics/lyricscomlyricsprovider.h" #include "scrobbler/audioscrobbler.h" #include "scrobbler/lastfmimport.h" @@ -153,7 +153,7 @@ class ApplicationImpl { lyrics_providers->AddProvider(new LoloLyricsProvider(lyrics_providers->network(), app)); lyrics_providers->AddProvider(new MusixmatchLyricsProvider(lyrics_providers->network(), app)); lyrics_providers->AddProvider(new ChartLyricsProvider(lyrics_providers->network(), app)); - lyrics_providers->AddProvider(new Stands4LyricsProvider(lyrics_providers->network(), app)); + lyrics_providers->AddProvider(new LyricsComLyricsProvider(lyrics_providers->network(), app)); lyrics_providers->ReloadSettings(); return lyrics_providers; }), diff --git a/src/lyrics/stands4lyricsprovider.cpp b/src/lyrics/lyricscomlyricsprovider.cpp similarity index 72% rename from src/lyrics/stands4lyricsprovider.cpp rename to src/lyrics/lyricscomlyricsprovider.cpp index 761d27f5..0c90682a 100644 --- a/src/lyrics/stands4lyricsprovider.cpp +++ b/src/lyrics/lyricscomlyricsprovider.cpp @@ -37,16 +37,16 @@ #include "utilities/strutils.h" #include "lyricssearchrequest.h" #include "lyricssearchresult.h" -#include "stands4lyricsprovider.h" +#include "lyricscomlyricsprovider.h" -const char *Stands4LyricsProvider::kApiUrl = "https://www.abbreviations.com/services/v2/lyrics.php"; -const char *Stands4LyricsProvider::kLyricsUrl = "https://www.lyrics.com/lyrics/"; -const char *Stands4LyricsProvider::kUID = "11363"; -const char *Stands4LyricsProvider::kTokenB64 = "b3FOYmxhV1ZKRGxIMnV4OA=="; +const char *LyricsComLyricsProvider::kApiUrl = "https://www.abbreviations.com/services/v2/lyrics.php"; +const char *LyricsComLyricsProvider::kLyricsUrl = "https://www.lyrics.com/lyrics/"; +const char *LyricsComLyricsProvider::kUID = "11363"; +const char *LyricsComLyricsProvider::kTokenB64 = "b3FOYmxhV1ZKRGxIMnV4OA=="; -Stands4LyricsProvider::Stands4LyricsProvider(NetworkAccessManager *network, QObject *parent) : JsonLyricsProvider("Stands4Lyrics", true, false, network, parent), use_api_(true) {} +LyricsComLyricsProvider::LyricsComLyricsProvider(NetworkAccessManager *network, QObject *parent) : JsonLyricsProvider("Lyrics.com", true, false, network, parent), use_api_(true) {} -Stands4LyricsProvider::~Stands4LyricsProvider() { +LyricsComLyricsProvider::~LyricsComLyricsProvider() { while (!replies_.isEmpty()) { QNetworkReply *reply = replies_.takeFirst(); @@ -57,7 +57,7 @@ Stands4LyricsProvider::~Stands4LyricsProvider() { } -bool Stands4LyricsProvider::StartSearch(const int id, const LyricsSearchRequest &request) { +bool LyricsComLyricsProvider::StartSearch(const int id, const LyricsSearchRequest &request) { if (use_api_) { SendSearchRequest(id, request); @@ -70,7 +70,7 @@ bool Stands4LyricsProvider::StartSearch(const int id, const LyricsSearchRequest } -void Stands4LyricsProvider::SendSearchRequest(const int id, const LyricsSearchRequest &request) { +void LyricsComLyricsProvider::SendSearchRequest(const int id, const LyricsSearchRequest &request) { QUrlQuery url_query; url_query.addQueryItem(QUrl::toPercentEncoding("uid"), QUrl::toPercentEncoding(kUID)); @@ -89,9 +89,9 @@ void Stands4LyricsProvider::SendSearchRequest(const int id, const LyricsSearchRe } -void Stands4LyricsProvider::CancelSearch(const int id) { Q_UNUSED(id); } +void LyricsComLyricsProvider::CancelSearch(const int id) { Q_UNUSED(id); } -void Stands4LyricsProvider::HandleSearchReply(QNetworkReply *reply, const int id, const LyricsSearchRequest &request) { +void LyricsComLyricsProvider::HandleSearchReply(QNetworkReply *reply, const int id, const LyricsSearchRequest &request) { if (!replies_.contains(reply)) return; replies_.removeAll(reply); @@ -108,54 +108,54 @@ void Stands4LyricsProvider::HandleSearchReply(QNetworkReply *reply, const int id QJsonDocument json_doc = QJsonDocument::fromJson(data, &json_error); if (json_error.error != QJsonParseError::NoError) { - qLog(Error) << "Stands4Lyrics: Failed to parse json data" << json_error.errorString(); + qLog(Error) << "Lyrics.com: Failed to parse json data" << json_error.errorString(); emit SearchFinished(id); return; } if (json_doc.isEmpty()) { - qLog(Debug) << "Stands4Lyrics: No lyrics for" << request.artist << request.album << request.title; + qLog(Debug) << "Lyrics.com: No lyrics for" << request.artist << request.album << request.title; emit SearchFinished(id); return; } if (!json_doc.isObject()) { - qLog(Error) << "Stands4Lyrics: Json document is not an object."; + qLog(Error) << "Lyrics.com: Json document is not an object."; emit SearchFinished(id); return; } QJsonObject json_obj = json_doc.object(); if (json_obj.isEmpty()) { - qLog(Debug) << "Stands4Lyrics: No lyrics for" << request.artist << request.album << request.title; + qLog(Debug) << "Lyrics.com: No lyrics for" << request.artist << request.album << request.title; emit SearchFinished(id); return; } if (json_obj.contains("error")) { const QString error = json_obj["error"].toString(); - qLog(Error) << "Stands4Lyrics: Received error:" << error << "switching to URL based lookup."; + qLog(Error) << "Lyrics.com: Received error:" << error << "switching to URL based lookup."; use_api_ = false; CreateLyricsRequest(id, request); return; } if (!json_obj.contains("result") || !json_obj["result"].isArray()) { - qLog(Error) << "Stands4Lyrics: Json reply is missing result."; + qLog(Error) << "Lyrics.com: Json reply is missing result."; emit SearchFinished(id); return; } QJsonArray json_result = json_obj["result"].toArray(); if (json_result.isEmpty()) { - qLog(Debug) << "Stands4Lyrics: No lyrics for" << request.artist << request.album << request.title; + qLog(Debug) << "Lyrics.com: No lyrics for" << request.artist << request.album << request.title; emit SearchFinished(id); return; } for (const QJsonValueRef value : json_result) { if (!value.isObject()) { - qLog(Error) << "Stands4Lyrics: Invalid Json reply, result is not an object."; + qLog(Error) << "Lyrics.com: Invalid Json reply, result is not an object."; continue; } QJsonObject obj = value.toObject(); @@ -165,7 +165,7 @@ void Stands4LyricsProvider::HandleSearchReply(QNetworkReply *reply, const int id !obj.contains("album") || !obj.contains("song-link") ) { - qLog(Error) << "Stands4Lyrics: Invalid Json reply, result is missing data."; + qLog(Error) << "Lyrics.com: Invalid Json reply, result is missing data."; qLog(Debug) << value; continue; } @@ -198,18 +198,18 @@ void Stands4LyricsProvider::HandleSearchReply(QNetworkReply *reply, const int id } - qLog(Debug) << "Stands4Lyrics: No lyrics for" << request.artist << request.album << request.title; + qLog(Debug) << "Lyrics.com: No lyrics for" << request.artist << request.album << request.title; emit SearchFinished(id); } -void Stands4LyricsProvider::CreateLyricsRequest(const int id, const LyricsSearchRequest &request) { +void LyricsComLyricsProvider::CreateLyricsRequest(const int id, const LyricsSearchRequest &request) { SendLyricsRequest(id, request, request.artist, request.album, request.title); } -void Stands4LyricsProvider::SendLyricsRequest(const int id, const LyricsSearchRequest &request, const QString &result_artist, const QString &result_album, const QString &result_title, QUrl url) { +void LyricsComLyricsProvider::SendLyricsRequest(const int id, const LyricsSearchRequest &request, const QString &result_artist, const QString &result_album, const QString &result_title, QUrl url) { if (url.isEmpty() || !url.isValid()) { url.setUrl(kLyricsUrl + StringFixup(result_artist) + "/" + StringFixup(result_title) + ".html"); @@ -223,7 +223,7 @@ void Stands4LyricsProvider::SendLyricsRequest(const int id, const LyricsSearchRe } -void Stands4LyricsProvider::HandleLyricsReply(QNetworkReply *reply, const int id, const LyricsSearchRequest &request, const QString &result_artist, const QString &result_album, const QString &result_title) { +void LyricsComLyricsProvider::HandleLyricsReply(QNetworkReply *reply, const int id, const LyricsSearchRequest &request, const QString &result_artist, const QString &result_album, const QString &result_title) { if (!replies_.contains(reply)) return; replies_.removeAll(reply); @@ -243,19 +243,19 @@ void Stands4LyricsProvider::HandleLyricsReply(QNetworkReply *reply, const int id const QByteArray data = reply->readAll(); if (data.isEmpty()) { - qLog(Error) << "Stands4Lyrics: Empty reply received from server."; + qLog(Error) << "Lyrics.com: Empty reply received from server."; emit SearchFinished(id); return; } const QString lyrics = ParseLyricsFromHTML(QString::fromUtf8(data), QRegularExpression("]*>"), QRegularExpression("<\\/div>"), QRegularExpression("
    ]+>"), false); if (lyrics.isEmpty() || lyrics.contains("Click to search for the Lyrics on Lyrics.com", Qt::CaseInsensitive)) { - qLog(Debug) << "Stands4Lyrics: No lyrics for" << request.artist << request.album << request.title; + qLog(Debug) << "Lyrics.com: No lyrics for" << request.artist << request.album << request.title; emit SearchFinished(id); return; } - qLog(Debug) << "Stands4Lyrics: Got lyrics for" << request.artist << request.album << request.title; + qLog(Debug) << "Lyrics.com: Got lyrics for" << request.artist << request.album << request.title; LyricsSearchResult result(lyrics); result.artist = result_artist; @@ -265,7 +265,7 @@ void Stands4LyricsProvider::HandleLyricsReply(QNetworkReply *reply, const int id } -QString Stands4LyricsProvider::StringFixup(QString string) { +QString LyricsComLyricsProvider::StringFixup(QString string) { return string.replace('/', '-') .replace('\'', '-') @@ -277,9 +277,9 @@ QString Stands4LyricsProvider::StringFixup(QString string) { } -void Stands4LyricsProvider::Error(const QString &error, const QVariant &debug) { +void LyricsComLyricsProvider::Error(const QString &error, const QVariant &debug) { - qLog(Error) << "Stands4Lyrics:" << error; + qLog(Error) << "Lyrics.com:" << error; if (debug.isValid()) qLog(Debug) << debug; } diff --git a/src/lyrics/stands4lyricsprovider.h b/src/lyrics/lyricscomlyricsprovider.h similarity index 87% rename from src/lyrics/stands4lyricsprovider.h rename to src/lyrics/lyricscomlyricsprovider.h index 85092a3d..de81a85f 100644 --- a/src/lyrics/stands4lyricsprovider.h +++ b/src/lyrics/lyricscomlyricsprovider.h @@ -17,8 +17,8 @@ * */ -#ifndef STANDS4LYRICSPROVIDER_H -#define STANDS4LYRICSPROVIDER_H +#ifndef LYRICSCOMLYRICSPROVIDER_H +#define LYRICSCOMLYRICSPROVIDER_H #include #include @@ -33,12 +33,12 @@ class QNetworkReply; class NetworkAccessManager; -class Stands4LyricsProvider : public JsonLyricsProvider { +class LyricsComLyricsProvider : public JsonLyricsProvider { Q_OBJECT public: - explicit Stands4LyricsProvider(NetworkAccessManager *network, QObject *parent = nullptr); - ~Stands4LyricsProvider() override; + explicit LyricsComLyricsProvider(NetworkAccessManager *network, QObject *parent = nullptr); + ~LyricsComLyricsProvider() override; bool StartSearch(const int id, const LyricsSearchRequest &request) override; void CancelSearch(const int id) override; @@ -63,4 +63,4 @@ class Stands4LyricsProvider : public JsonLyricsProvider { bool use_api_; }; -#endif // STANDS4LYRICSPROVIDER_H +#endif // LYRICSCOMLYRICSPROVIDER_H