settings: add support for preferred last.fm info language

master
Andrzej Rybczak 16 years ago
parent a7b9088b87
commit 342521459c
  1. 10
      doc/config
  2. 3
      doc/ncmpcpp.1
  3. 2
      src/ncmpcpp.cpp
  4. 5
      src/settings.cpp
  5. 1
      src/settings.h

@ -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"

@ -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

@ -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

@ -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())

@ -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;

Loading…
Cancel
Save