settings: add support for preferred last.fm info language

This commit is contained in:
Andrzej Rybczak
2010-08-13 06:11:13 +02:00
parent a7b9088b87
commit 342521459c
5 changed files with 20 additions and 1 deletions

View File

@@ -287,6 +287,16 @@
#
#follow_now_playing_lyrics = "no"
#
##
## Note: If you set this variable, ncmpcpp will try to
## get info from last.fm in language you set and if it
## fails, it will fall back to english. Otherwise it will
## use english the first time.
##
## Note: Language has to be expressed as an ISO 639 alpha-2 code.
##
#lastfm_preferred_language = ""
#
#ncmpc_like_songs_adding = "no" (enabled - add/remove, disabled - always add)
#
#show_hidden_files_in_local_browser = "no"

View File

@@ -219,6 +219,9 @@ If enabled, seek time will increment by one each second of seeking.
.B follow_now_playing_lyrics = yes/no
If enabled, lyrics will be switched at song's change to currently playing one's (Note: this works only if you are viewing lyrics of item from Playlist).
.TP
.B lastfm_preferred_language = ISO 639 alpha-2 language code
If set, ncmpcpp will try to get info from last.fm in language you set and if it fails, it will fall back to english. Otherwise it will use english the first time.
.TP
.B ncmpc_like_songs_adding = yes/no
If enabled, pressing space on item, which is already in playlist will remove it, otherwise add it again.
.TP

View File

@@ -2068,7 +2068,7 @@ int main(int argc, char *argv[])
else if (myScreen == myLibrary && myLibrary->Main() == myLibrary->Artists)
artist = myLibrary->Artists->Current();
if (!artist.empty() && myLastfm->SetArtistInfoArgs(artist))
if (!artist.empty() && myLastfm->SetArtistInfoArgs(artist, Config.lastfm_preferred_language))
myLastfm->SwitchTo();
}
# endif // HAVE_CURL_CURL_H

View File

@@ -763,6 +763,11 @@ void NcmpcppConfig::Read()
new_header_second_line += '}';
}
}
else if (cl.find("lastfm_preferred_language") != std::string::npos)
{
if (!v.empty() && v != "en")
lastfm_preferred_language = v;
}
else if (cl.find("browser_playlist_prefix") != std::string::npos)
{
if (!v.empty())

View File

@@ -166,6 +166,7 @@ struct NcmpcppConfig
std::string execute_on_song_change;
std::string new_header_first_line;
std::string new_header_second_line;
std::string lastfm_preferred_language;
std::basic_string<my_char_t> progressbar;
std::string pattern;