Bug#677233: proto-patches

Jon Dowland jmtd at debian.org
Tue Jun 26 22:45:50 UTC 2012


I was hoping to have this patch finished today and beg for an upload prior to
the freeze, but 3-5 is not a straightforward substitution ☹ 

Attached are two patches: a straightforward substitution and the beginnings of
fixing up the bits that need fixing.  I still hope to have this ready for
squeeze.

(don't mind the NMU stuff in these patches, that's just from my working copy)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mb5.patch
Type: text/x-diff
Size: 5238 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-multimedia-maintainers/attachments/20120626/b72b9671/attachment.patch>
-------------- next part --------------
--- gnome-mplayer-1.0.6.orig/src/support.c
+++ gnome-mplayer-1.0.6/src/support.c
@@ -2330,7 +2330,6 @@ gboolean gpod_load_tracks(gchar * mount_
 gchar *get_cover_art_url(gchar * artist, gchar * title, gchar * album)
 {
     int i;
-    Mb5WebService mb;
     Mb5Query query;
     Mb5ReleaseFilter release_filter;
     Mb5ResultList results;
@@ -2342,26 +2341,34 @@ gchar *get_cover_art_url(gchar * artist,
     gchar *ret = NULL;
     gint score, highest_score;
 
+    param_names = g_new (gchar*, 3);
+    param_values = g_new (gchar*, 3);
+
     if (disable_cover_art_fetch)
         return ret;
 
     if (album == NULL && artist == NULL)
         return ret;
 
-    mb = mb5_webservice_new();
+    query = mb5_query_new(mb, "gnome-mplayer", 0);
 
-    query = mb5_query_new(mb, "gnome-mplayer");
+    param_names[0] = g_strdup ("query");
+    if (artist != NULL && strlen(artist) > 0) {
+        if (album != NULL && strlen(album) > 0) {
+            param_values[0] = g_strdup_printf ("artist:\"%s\" AND release:\"%s\"", artist, album);
+        } else {
+            param_values[0] = g_strdup_printf ("artist:\"%s\"", artist);
+        }
+    } else if (album != NULL && strlen(album) > 0) {
+        param_values[0] = g_strdup_printf ("release:\"%s\"", album);
+    }
 
-    release_filter = mb5_release_filter_new();
-    if (release_filter == NULL)
-        return ret;
-    if (artist != NULL && strlen(artist) > 0)
-        release_filter = mb5_release_filter_artist_name(release_filter, artist);
-    if (album != NULL && strlen(album) > 0)
-        release_filter = mb5_release_filter_title(release_filter, album);
+    param_names[1] = g_strdup ("limit");
+    param_values[1] = g_strdup ("1"); // XXX: probably want more than that
+    param_names[2] = NULL;
+    param_values[2] = NULL;
 
-    results = mb5_query_get_releases(query, release_filter);
-    mb5_release_filter_free(release_filter);
+    results = mb5_query_query(query, "release", "", "", 2, param_names, param_values);
 
     if (results != NULL) {
         //printf("items found:  %i\n", mb5_result_list_get_size(results));
@@ -2401,6 +2408,8 @@ gchar *get_cover_art_url(gchar * artist,
 
     mb5_query_free(query);
     mb5_webservice_free(mb);
+    g_strfreev (param_names);
+    g_strfreev (param_values);
 
     return ret;
 }


More information about the pkg-multimedia-maintainers mailing list