diff options
author | Lars-Dominik Braun <PromyLOPh@gmail.com> | 2008-06-23 22:08:18 +0200 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@gmail.com> | 2008-06-23 22:08:18 +0200 |
commit | 455fb16d627e1f45c2651c35f743ef16e20b0c45 (patch) | |
tree | ac4bb54750d0882a8267dc1a9baf1ac2e55effef /src/settings.c | |
parent | f0bab69d9d09fb0a80091d813cc57a85fc3d8c61 (diff) | |
download | pianobar-windows-455fb16d627e1f45c2651c35f743ef16e20b0c45.tar.gz pianobar-windows-455fb16d627e1f45c2651c35f743ef16e20b0c45.tar.bz2 pianobar-windows-455fb16d627e1f45c2651c35f743ef16e20b0c45.zip |
client: Let user decide when song is submitted to last.fm
Diffstat (limited to 'src/settings.c')
-rw-r--r-- | src/settings.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/settings.c b/src/settings.c index 91cd851..3a0ed4a 100644 --- a/src/settings.c +++ b/src/settings.c @@ -111,8 +111,18 @@ void BarSettingsRead (BarSettings_t *settings) { settings->lastfmUser = strdup (val); } else if (strcmp ("lastfm_password", key) == 0) { settings->lastfmPassword = strdup (val); + } else if (strcmp ("lastfm_scrobble_percent", key) == 0) { + settings->lastfmScrobblePercent = atoi (val); } } + + /* some checks */ + /* last.fm requests tracks to be played at least 50% */ + if (settings->lastfmScrobblePercent < 50 || + settings->lastfmScrobblePercent > 100) { + settings->lastfmScrobblePercent = 50; + } + /* only scrobble tracks if username and password are set */ if (settings->lastfmUser != NULL && settings->lastfmPassword != NULL) { settings->enableScrobbling = 1; } |