[rhythmbox] audioscrobbler: escaped artist and track names when loving/banning tracks
- From: Jonathan Matthew <jmatthew src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rhythmbox] audioscrobbler: escaped artist and track names when loving/banning tracks
- Date: Tue, 21 Sep 2010 10:52:32 +0000 (UTC)
commit fd917fd09ca8f761ed0f261a3d1e6e786eb6025a
Author: Jamie Nicol <jamie thenicols net>
Date: Mon Jul 19 12:35:50 2010 +0100
audioscrobbler: escaped artist and track names when loving/banning tracks
.../rb-audioscrobbler-radio-source.c | 4 +--
plugins/audioscrobbler/rb-audioscrobbler-user.c | 22 ++++++++++++++++---
2 files changed, 19 insertions(+), 7 deletions(-)
---
diff --git a/plugins/audioscrobbler/rb-audioscrobbler-radio-source.c b/plugins/audioscrobbler/rb-audioscrobbler-radio-source.c
index b8148bb..45cba0e 100644
--- a/plugins/audioscrobbler/rb-audioscrobbler-radio-source.c
+++ b/plugins/audioscrobbler/rb-audioscrobbler-radio-source.c
@@ -622,9 +622,7 @@ rb_audioscrobbler_radio_source_tune (RBAudioscrobblerRadioSource *source)
sig = g_compute_checksum_for_string (G_CHECKSUM_MD5, sig_arg, -1);
- escaped_station_url = g_uri_escape_string (source->priv->station_url,
- NULL,
- FALSE);
+ escaped_station_url = g_uri_escape_string (source->priv->station_url, NULL, FALSE);
request = g_strdup_printf ("method=radio.tune&station=%s&api_key=%s&api_sig=%s&sk=%s",
escaped_station_url,
diff --git a/plugins/audioscrobbler/rb-audioscrobbler-user.c b/plugins/audioscrobbler/rb-audioscrobbler-user.c
index b941cb4..815ede4 100644
--- a/plugins/audioscrobbler/rb-audioscrobbler-user.c
+++ b/plugins/audioscrobbler/rb-audioscrobbler-user.c
@@ -1624,6 +1624,8 @@ rb_audioscrobbler_user_love_track (RBAudioscrobblerUser *user,
{
char *sig_arg;
char *sig;
+ char *escaped_title;
+ char *escaped_artist;
char *request;
SoupMessage *msg;
@@ -1638,9 +1640,12 @@ rb_audioscrobbler_user_love_track (RBAudioscrobblerUser *user,
sig = g_compute_checksum_for_string (G_CHECKSUM_MD5, sig_arg, -1);
+ escaped_title = g_uri_escape_string (title, NULL, FALSE);
+ escaped_artist = g_uri_escape_string (artist, NULL, FALSE);
+
request = g_strdup_printf ("method=track.love&track=%s&artist=%s&api_key=%s&api_sig=%s&sk=%s",
- title,
- artist,
+ escaped_title,
+ escaped_artist,
rb_audioscrobbler_service_get_api_key (user->priv->service),
sig,
user->priv->session_key);
@@ -1658,6 +1663,8 @@ rb_audioscrobbler_user_love_track (RBAudioscrobblerUser *user,
g_free (sig_arg);
g_free (sig);
+ g_free (escaped_title);
+ g_free (escaped_artist);
g_free (request);
}
@@ -1678,6 +1685,8 @@ rb_audioscrobbler_user_ban_track (RBAudioscrobblerUser *user,
{
char *sig_arg;
char *sig;
+ char *escaped_title;
+ char *escaped_artist;
char *request;
SoupMessage *msg;
@@ -1692,9 +1701,12 @@ rb_audioscrobbler_user_ban_track (RBAudioscrobblerUser *user,
sig = g_compute_checksum_for_string (G_CHECKSUM_MD5, sig_arg, -1);
+ escaped_title = g_uri_escape_string (title, NULL, FALSE);
+ escaped_artist = g_uri_escape_string (artist, NULL, FALSE);
+
request = g_strdup_printf ("method=track.ban&track=%s&artist=%s&api_key=%s&api_sig=%s&sk=%s",
- title,
- artist,
+ escaped_title,
+ escaped_artist,
rb_audioscrobbler_service_get_api_key (user->priv->service),
sig,
user->priv->session_key);
@@ -1712,6 +1724,8 @@ rb_audioscrobbler_user_ban_track (RBAudioscrobblerUser *user,
g_free (sig_arg);
g_free (sig);
+ g_free (escaped_title);
+ g_free (escaped_artist);
g_free (request);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]