diff options
author | Lars-Dominik Braun <PromyLOPh@gmail.com> | 2008-06-22 12:16:31 +0200 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@gmail.com> | 2008-06-22 12:16:31 +0200 |
commit | a3a3898e37944e64a58d412022931496318e6209 (patch) | |
tree | 1591d52be044c60be5d8a49a278f0451ef2366ab /src/settings.c | |
parent | 7758eeaaafb49bb8c2ced598f3a9480978ba8265 (diff) | |
download | pianobar-windows-a3a3898e37944e64a58d412022931496318e6209.tar.gz pianobar-windows-a3a3898e37944e64a58d412022931496318e6209.tar.bz2 pianobar-windows-a3a3898e37944e64a58d412022931496318e6209.zip |
client: last.fm scrobbling implemented
Very very ugly... We should spawn another thread. But for now it's working.
(Though the played times are wrong for me, could be a wardrobe issue...)
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 91fce9a..abdf5b7 100644 --- a/src/settings.c +++ b/src/settings.c @@ -62,6 +62,9 @@ void BarSettingsDestroy (BarSettings_t *settings) { free (settings->controlProxy); free (settings->username); free (settings->password); + free (settings->lastfmUser); + free (settings->lastfmPassword); + memset (settings, 0, sizeof (*settings)); } /* read app settings from file; format is: key = value\n @@ -104,8 +107,15 @@ void readSettings (BarSettings_t *settings) { settings->username = strdup (val); } else if (strcmp ("password", key) == 0) { settings->password = strdup (val); + } else if (strcmp ("lastfm_user", key) == 0) { + settings->lastfmUser = strdup (val); + } else if (strcmp ("lastfm_password", key) == 0) { + settings->lastfmPassword = strdup (val); } } + if (settings->lastfmUser != NULL && settings->lastfmPassword != NULL) { + settings->enableScrobbling = 1; + } fclose (configfd); } |