diff src/scrobbler/plugin.c @ 3109:5a11abf0075c

scrobbler: add support for custom audioscrobbler servers. (closes #23)
author William Pitcock <nenolod@atheme.org>
date Fri, 01 May 2009 12:28:48 -0500
parents 3134a0987162
children
line wrap: on
line diff
--- a/src/scrobbler/plugin.c	Thu Apr 30 18:23:44 2009 -0400
+++ b/src/scrobbler/plugin.c	Fri May 01 12:28:48 2009 -0500
@@ -99,7 +99,7 @@
 }
 
 void start(void) {
-	char *username = NULL, *password = NULL;
+	char *username = NULL, *password = NULL, *sc_url = NULL;
 	char *ge_username = NULL, *ge_password = NULL;
 	mcs_handle_t *cfgfile;
 	sc_going = 1;
@@ -111,6 +111,8 @@
 				&username);
 		aud_cfg_db_get_string(cfgfile, "audioscrobbler", "password",
 				&password);
+		aud_cfg_db_get_string(cfgfile, "audioscrobbler", "sc_url",
+				&sc_url);		
 		aud_cfg_db_get_string(cfgfile, "audioscrobbler", "ge_username",
 				&ge_username);
 		aud_cfg_db_get_string(cfgfile, "audioscrobbler", "ge_password",
@@ -126,10 +128,11 @@
 	}
 	else
 	{
-		sc_init(username, password);
+		sc_init(username, password, sc_url);
 
 		g_free(username);
 		g_free(password);
+		g_free(sc_url);
 	}
 	
 	if ((!ge_username || !ge_password) || (!*ge_username || !*ge_password))