[librest] lastfm: Fix function setting regression



commit 1d71e83ac3ff7baaee43e0e66daaeeecb4ba96b4
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Tue Sep 2 18:14:32 2014 +0200

    lastfm: Fix function setting regression
    
    Since commit c66b6d, RestProxyCall::url is regenerated after calling the
    RestProxyCall::prepare virtual method. This breaks the lastfm code as
    it needs to reset RestProxyCall::url in order to remove the function
    from it.
    
    It used to do that by directly accessing RestProxyCall private
    data. Since c66b6d, this can be solved using only public methods as
    if the function is reset on the RestProxyCall in ::prepare, ::url will
    be regenerated to reflect that after ::prepare and ::serialize_params
    have been called.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=708359

 rest-extras/lastfm-proxy-call.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/rest-extras/lastfm-proxy-call.c b/rest-extras/lastfm-proxy-call.c
index 5e04038..f4bba60 100644
--- a/rest-extras/lastfm-proxy-call.c
+++ b/rest-extras/lastfm-proxy-call.c
@@ -44,14 +44,15 @@ _prepare (RestProxyCall *call, GError **error)
   priv = LASTFM_PROXY_GET_PRIVATE (proxy);
   call_priv = call->priv;
 
-  /* First reset the URL because Lastfm puts the function in the parameters */
-  call_priv->url = g_strdup (_rest_proxy_get_bound_url (REST_PROXY (proxy)));
 
   rest_proxy_call_add_params (call,
                               "method", call_priv->function,
                               "api_key", priv->api_key,
                               NULL);
 
+  /* Reset function because Lastfm puts the function in the parameters */
+  rest_proxy_call_set_function (call, NULL);
+
   if (priv->session_key)
     rest_proxy_call_add_param (call, "sk", priv->session_key);
 


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