remove lyricswiki support as it doesn't allow fetching lyrics anymore

This commit is contained in:
Andrzej Rybczak
2009-08-05 14:35:45 +02:00
parent e5e8261c40
commit 27ede67685
5 changed files with 18 additions and 30 deletions

View File

@@ -200,8 +200,7 @@
##
## supported lyrics databases:
##
## - 1 - lyricwiki.org
## - 2 - lyricsplugin.com
## - 1 - lyricsplugin.com
##
#
#lyrics_database = "1"

View File

@@ -206,8 +206,7 @@ Type of currently used regular expressions.
.TP
.B lyrics_database = NUMBER
Number of lyrics database in use. Currently supported DBs are:
1 - lyricwiki.org
2 - lyricsplugin.com
1 - lyricsplugin.com
.TP
.B media_library_left_column = a/y/g/c/p
Default tag type for left column in media library. Legend for possible letters is in SONG FORMAT section.

View File

@@ -313,16 +313,19 @@ void Lyrics::Take()
}
#endif // HAVE_PTHREAD_H
const unsigned Lyrics::DBs = 1; // number of currently supported lyrics databases
const char *Lyrics::PluginsList[] =
{
"lyricsplugin.com",
0
};
const char *Lyrics::GetPluginName(int offset)
{
return PluginsList[offset];
}
bool Lyrics::LyricWiki_NotFound(const std::string &s)
{
return s == "Not found";
}
bool Lyrics::LyricsPlugin_NotFound(const std::string &s)
{
if (s.empty())
@@ -333,14 +336,6 @@ bool Lyrics::LyricsPlugin_NotFound(const std::string &s)
return true;
}
const Lyrics::Plugin Lyrics::LyricWiki =
{
"http://lyricwiki.org/api.php?artist=%artist%&song=%title%&fmt=xml",
"<lyrics>",
"</lyrics>",
LyricWiki_NotFound
};
const Lyrics::Plugin Lyrics::LyricsPlugin =
{
"http://www.lyricsplugin.com/winamp03/plugin/?artist=%artist%&title=%title%",
@@ -349,23 +344,14 @@ const Lyrics::Plugin Lyrics::LyricsPlugin =
LyricsPlugin_NotFound
};
const char *Lyrics::PluginsList[] =
{
"lyricwiki.org",
"lyricsplugin.com",
0
};
const Lyrics::Plugin *Lyrics::ChoosePlugin(int i)
{
switch (i)
{
case 0:
return &LyricWiki;
case 1:
return &LyricsPlugin;
default:
return &LyricWiki;
return &LyricsPlugin;
}
}

View File

@@ -63,6 +63,8 @@ class Lyrics : public Screen<Scrollpad>
# ifdef HAVE_CURL_CURL_H
static const char *GetPluginName(int offset);
static const unsigned DBs;
# endif // HAVE_CURL_CURL_H
protected:
@@ -81,7 +83,6 @@ class Lyrics : public Screen<Scrollpad>
# endif // HAVE_PTHREAD_H
static const Plugin *ChoosePlugin(int);
static bool LyricWiki_NotFound(const std::string &);
static bool LyricsPlugin_NotFound(const std::string &);
static bool Ready;
@@ -91,7 +92,6 @@ class Lyrics : public Screen<Scrollpad>
# endif // HAVE_PTHREAD_H
static const char *PluginsList[];
static const Plugin LyricWiki;
static const Plugin LyricsPlugin;
# endif // HAVE_CURL_CURL_H

View File

@@ -26,6 +26,7 @@
#include <fstream>
#include "helpers.h"
#include "lyrics.h"
#include "settings.h"
const std::string config_file = config_dir + "config";
@@ -702,7 +703,10 @@ void ReadConfiguration(ncmpcpp_config &conf)
else if (cl.find("lyrics_database") != std::string::npos)
{
if (!v.empty())
conf.lyrics_db = StrToInt(v)-1;
{
unsigned n = StrToInt(v)-1;
conf.lyrics_db = n < Lyrics::DBs ? n : 0;
}
}
else if (cl.find("song_window_title_format") != std::string::npos)
{