settings: add support for preferred last.fm info language
This commit is contained in:
10
doc/config
10
doc/config
@@ -287,6 +287,16 @@
|
|||||||
#
|
#
|
||||||
#follow_now_playing_lyrics = "no"
|
#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)
|
#ncmpc_like_songs_adding = "no" (enabled - add/remove, disabled - always add)
|
||||||
#
|
#
|
||||||
#show_hidden_files_in_local_browser = "no"
|
#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
|
.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).
|
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
|
.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
|
.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.
|
If enabled, pressing space on item, which is already in playlist will remove it, otherwise add it again.
|
||||||
.TP
|
.TP
|
||||||
|
|||||||
@@ -2068,7 +2068,7 @@ int main(int argc, char *argv[])
|
|||||||
else if (myScreen == myLibrary && myLibrary->Main() == myLibrary->Artists)
|
else if (myScreen == myLibrary && myLibrary->Main() == myLibrary->Artists)
|
||||||
artist = myLibrary->Artists->Current();
|
artist = myLibrary->Artists->Current();
|
||||||
|
|
||||||
if (!artist.empty() && myLastfm->SetArtistInfoArgs(artist))
|
if (!artist.empty() && myLastfm->SetArtistInfoArgs(artist, Config.lastfm_preferred_language))
|
||||||
myLastfm->SwitchTo();
|
myLastfm->SwitchTo();
|
||||||
}
|
}
|
||||||
# endif // HAVE_CURL_CURL_H
|
# endif // HAVE_CURL_CURL_H
|
||||||
|
|||||||
@@ -763,6 +763,11 @@ void NcmpcppConfig::Read()
|
|||||||
new_header_second_line += '}';
|
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)
|
else if (cl.find("browser_playlist_prefix") != std::string::npos)
|
||||||
{
|
{
|
||||||
if (!v.empty())
|
if (!v.empty())
|
||||||
|
|||||||
@@ -166,6 +166,7 @@ struct NcmpcppConfig
|
|||||||
std::string execute_on_song_change;
|
std::string execute_on_song_change;
|
||||||
std::string new_header_first_line;
|
std::string new_header_first_line;
|
||||||
std::string new_header_second_line;
|
std::string new_header_second_line;
|
||||||
|
std::string lastfm_preferred_language;
|
||||||
std::basic_string<my_char_t> progressbar;
|
std::basic_string<my_char_t> progressbar;
|
||||||
|
|
||||||
std::string pattern;
|
std::string pattern;
|
||||||
|
|||||||
Reference in New Issue
Block a user