From 5d87a6d9205a5debaacc7912107ce5591a48879b Mon Sep 17 00:00:00 2001 From: Qball Cow Date: Tue, 27 Jan 2009 13:57:45 +0100 Subject: [PATCH] Use gmpc's escape function --- src/plugin.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/plugin.c b/src/plugin.c index 5311515..b9042df 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -225,7 +225,7 @@ gchar *__lastfm_art_get_artist_similar(char *nartist) gmpc_easy_download_struct data= {NULL, 0,-1,NULL, NULL}; char furl[1024]; - char *artist = g_uri_escape_string(nartist, NULL, TRUE); + char *artist = gmpc_easy_download_uri_escape(nartist); snprintf(furl,1024,LASTFM_API_ROOT"?method=artist.getsimilar&artist=%s&api_key=%s", artist,LASTFM_API_KEY); debug_printf(DEBUG_INFO, "furl: %s\n", furl); g_free(artist); @@ -307,8 +307,8 @@ static gchar *__lastfm_art_get_song_similar(char *nartist, char *ntitle) gmpc_easy_download_struct data= {NULL, 0,-1,NULL, NULL}; char furl[1024]; - char *artist = g_uri_escape_string(nartist, NULL, TRUE); - char *title = g_uri_escape_string(ntitle, NULL, TRUE); + char *artist = gmpc_easy_download_uri_escape(nartist); + char *title = gmpc_easy_download_uri_escape(ntitle); snprintf(furl,1024,LASTFM_API_ROOT"?method=track.getsimilar&artist=%s&track=%s&api_key=%s", artist,title,LASTFM_API_KEY); debug_printf(DEBUG_INFO, "furl: %s\n", furl); g_free(artist); @@ -396,7 +396,7 @@ static gchar *__lastfm_art_get_artist_txt(mpd_Song *song) gmpc_easy_download_struct data= {NULL, 0,-1,NULL, NULL}; char furl[1024]; - char *artist = g_uri_escape_string(song->artist, NULL, TRUE); + char *artist = gmpc_easy_download_uri_escape(song->artist); /* Create the uri */ snprintf(furl,1024, LASTFM_API_ROOT"?method=artist.getinfo&artist=%s&api_key=%s", artist,LASTFM_API_KEY); /* free artist name */ @@ -461,8 +461,8 @@ static gchar *__lastfm_art_get_artist_txt(mpd_Song *song) static int lastfm_fetch_cover_album_art(mpd_Song *song, char **path) { int retval; - char *artist = g_uri_escape_string(song->artist, NULL, TRUE); - char *album = g_uri_escape_string(song->album, NULL, TRUE); + char *artist = gmpc_easy_download_uri_escape(song->artist); + char *album = gmpc_easy_download_uri_escape(song->album); debug_printf(DEBUG_INFO, "Trying to fetch: %s:%s\n", artist, album); retval = __lastfm_art_get_album_image(song,artist,album, path); g_free(artist); @@ -473,7 +473,7 @@ static int lastfm_fetch_cover_album_art(mpd_Song *song, char **path) static int lastfm_fetch_cover_art(mpd_Song *song, char **path) { int retval; - char *artist = g_uri_escape_string(song->artist, NULL, TRUE); + char *artist = gmpc_easy_download_uri_escape(song->artist); retval = __lastfm_art_get_artist_image(song,artist,path); g_free(artist); return retval; -- 2.11.4.GIT