rhythmbox r6289 - in trunk: . data lib plugins/audioscrobbler



Author: jmatthew
Date: Sun Apr 12 07:59:32 2009
New Revision: 6289
URL: http://svn.gnome.org/viewvc/rhythmbox?rev=6289&view=rev

Log:
2009-04-12  Jonathan Matthew  <jonathan d14n org>

	* data/rhythmbox.schemas:
	* lib/rb-preferences.h:
	* plugins/audioscrobbler/rb-audioscrobbler.c:
	(rb_audioscrobbler_do_handshake):
	Read the initial track submission handshake URL from gconf key
	/apps/rhythmbox/audioscrobbler/scrobbler_url, allowing
	it to be redirected to other services such as libre.fm without having
	to modify /etc/hosts.


Modified:
   trunk/ChangeLog
   trunk/data/rhythmbox.schemas
   trunk/lib/rb-preferences.h
   trunk/plugins/audioscrobbler/rb-audioscrobbler.c

Modified: trunk/data/rhythmbox.schemas
==============================================================================
--- trunk/data/rhythmbox.schemas	(original)
+++ trunk/data/rhythmbox.schemas	Sun Apr 12 07:59:32 2009
@@ -822,6 +822,17 @@
         </locale>
       </schema>
       <schema>
+        <key>/schemas/apps/rhythmbox/audioscrobbler/scrobbler_url</key>
+        <applyto>/apps/rhythmbox/audioscrobbler/scrobbler_url</applyto>
+        <owner>rhythmbox</owner>
+        <type>string</type>
+        <default>http://post.audioscrobbler.com/</default>
+        <locale name="C">
+	<short>URL for last.fm-style track submission</short>
+	<long>URL for last.fm-style track submission.  This can be used to direct track submission to an alternate service such as libre.fm.</long>
+        </locale>
+      </schema>
+      <schema>
         <key>/schemas/apps/rhythmbox/ui/show_notifications</key>
         <applyto>/apps/rhythmbox/ui/show_notifications</applyto>
         <owner>rhythmbox</owner>

Modified: trunk/lib/rb-preferences.h
==============================================================================
--- trunk/lib/rb-preferences.h	(original)
+++ trunk/lib/rb-preferences.h	Sun Apr 12 07:59:32 2009
@@ -59,6 +59,7 @@
 
 #define CONF_AUDIOSCROBBLER_USERNAME CONF_PREFIX "/audioscrobbler/username"
 #define CONF_AUDIOSCROBBLER_PASSWORD CONF_PREFIX "/audioscrobbler/password"
+#define CONF_AUDIOSCROBBLER_URL      CONF_PREFIX "/audioscrobbler/scrobbler_url"
 
 #define CONF_DAAP_ENABLE_SHARING   CONF_PREFIX "/sharing/enable_sharing"
 #define CONF_DAAP_SHARE_NAME       CONF_PREFIX "/sharing/share_name"

Modified: trunk/plugins/audioscrobbler/rb-audioscrobbler.c
==============================================================================
--- trunk/plugins/audioscrobbler/rb-audioscrobbler.c	(original)
+++ trunk/plugins/audioscrobbler/rb-audioscrobbler.c	Sun Apr 12 07:59:32 2009
@@ -826,6 +826,7 @@
 static void
 rb_audioscrobbler_do_handshake (RBAudioscrobbler *audioscrobbler)
 {
+	gchar *scrobbler_url;
 	gchar *username;
 	gchar *url;
 
@@ -833,13 +834,19 @@
 		return;
 	}
 
+	scrobbler_url = eel_gconf_get_string (CONF_AUDIOSCROBBLER_URL);
+	if (scrobbler_url == NULL) {
+		scrobbler_url = g_strdup (SCROBBLER_URL);
+	}
+
 	username = soup_uri_encode (audioscrobbler->priv->username, EXTRA_URI_ENCODE_CHARS);
 	url = g_strdup_printf ("%s?hs=true&p=%s&c=%s&v=%s&u=%s",
-			       SCROBBLER_URL,
+			       scrobbler_url,
 			       SCROBBLER_VERSION,
 			       CLIENT_ID,
 			       CLIENT_VERSION,
 			       username);
+	g_free (scrobbler_url);
 	g_free (username);
 
 	/* Make sure we wait at least 30 minutes between handshakes. */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]