summaryrefslogtreecommitdiff
path: root/src/settings.c
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@gmail.com>2008-06-22 12:16:31 +0200
committerLars-Dominik Braun <PromyLOPh@gmail.com>2008-06-22 12:16:31 +0200
commita3a3898e37944e64a58d412022931496318e6209 (patch)
tree1591d52be044c60be5d8a49a278f0451ef2366ab /src/settings.c
parent7758eeaaafb49bb8c2ced598f3a9480978ba8265 (diff)
downloadpianobar-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.c10
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);
}