From 74d177feae0f1e93d00bf07cb872f0f0d5db5a79 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sun, 8 Aug 2010 03:16:40 +0200 Subject: [PATCH] replace lyricsplugin.com with lyrc.com.ar as the former no longer works this is sorta workaround, I need to add at least leolyrics and lyricsfly databases support, but they require unique user ids. btw, plugin system in its current form is horrible mess and it *really* needs to be redesigned. --- doc/config | 2 +- src/lyrics.cpp | 25 +++++++++++++++++++++---- src/lyrics.h | 6 ++++-- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/doc/config b/doc/config index db914f77..a8edceff 100644 --- a/doc/config +++ b/doc/config @@ -388,7 +388,7 @@ ## ## supported lyrics databases: ## -## - 1 - lyricsplugin.com +## - 1 - lyrc.com.ar ## # #lyrics_database = "1" diff --git a/src/lyrics.cpp b/src/lyrics.cpp index 7ab8e780..11c86f13 100644 --- a/src/lyrics.cpp +++ b/src/lyrics.cpp @@ -341,7 +341,8 @@ const unsigned Lyrics::DBs = 1; // number of currently supported lyrics database const char *Lyrics::PluginsList[] = { - "lyricsplugin.com", + //"lyricsplugin.com", + "lyrc.com.ar", 0 }; @@ -350,7 +351,7 @@ const char *Lyrics::GetPluginName(int offset) return PluginsList[offset]; } -bool Lyrics::LyricsPlugin_NotFound(const std::string &s) +/*bool Lyrics::LyricsPlugin_NotFound(const std::string &s) { if (s.empty()) return true; @@ -366,6 +367,21 @@ const Lyrics::Plugin Lyrics::LyricsPlugin = "
", "
", LyricsPlugin_NotFound +};*/ + +bool Lyrics::LyrcComAr_NotFound(const std::string &s) +{ + // it should never fail as open_tag and close_tag + // are not present if lyrics are not found + return false; +} + +const Lyrics::Plugin Lyrics::LyrcComAr = +{ + "http://lyrc.com.ar/tema1es.php?artist=%artist%&songname=%title%", + "", + "

", + LyrcComAr_NotFound }; const Lyrics::Plugin *Lyrics::ChoosePlugin(int i) @@ -373,9 +389,10 @@ const Lyrics::Plugin *Lyrics::ChoosePlugin(int i) switch (i) { case 0: - return &LyricsPlugin; + //return &LyricsPlugin; + return &LyrcComAr; default: - return &LyricsPlugin; + return &LyrcComAr; } } diff --git a/src/lyrics.h b/src/lyrics.h index 8e172ab9..b9879b2c 100644 --- a/src/lyrics.h +++ b/src/lyrics.h @@ -84,7 +84,8 @@ class Lyrics : public Screen # endif // HAVE_PTHREAD_H static const Plugin *ChoosePlugin(int); - static bool LyricsPlugin_NotFound(const std::string &); + //static bool LyricsPlugin_NotFound(const std::string &); + static bool LyrcComAr_NotFound(const std::string &); static bool Ready; @@ -93,7 +94,8 @@ class Lyrics : public Screen # endif // HAVE_PTHREAD_H static const char *PluginsList[]; - static const Plugin LyricsPlugin; + //static const Plugin LyricsPlugin; + static const Plugin LyrcComAr; # endif // HAVE_CURL_CURL_H size_t itsScrollBegin;