From 21c66b7c06a12f34d485f36522454a2a729e6839 Mon Sep 17 00:00:00 2001 From: jrl Date: Tue, 12 Dec 2006 06:21:53 +0000 Subject: [PATCH] 2006-12-12 James Livingston * plugins/audioscrobbler/Makefile.am: * metadata/sj-error.c: (sj_error_quark): * metadata/sj-error.h: * metadata/sj-metadata-musicbrainz.c: (sj_metadata_musicbrainz_instance_init), (get_offline_track_listing), (cache_rdf), (get_cached_rdf), (get_rdf), (lookup_cd): * metadata/sj-metadata-musicbrainz.h: * metadata/sj-metadata.c: (sj_metadata_get_type): * metadata/sj-metadata.h: * metadata/sj-structures.c: * metadata/sj-structures.h: get bug fixes from S-J and hopefully fix #382954. --- ChangeLog | 16 +++++++ doc/reference/tmpl/rb-daap-share.sgml | 1 + doc/reference/tmpl/rb-daap-source.sgml | 26 ------------ doc/reference/tmpl/rb-debug.sgml | 2 + doc/reference/tmpl/rb-header.sgml | 10 +---- doc/reference/tmpl/rb-shell.sgml | 1 + doc/reference/tmpl/rb-tray-icon.sgml | 1 + doc/reference/tmpl/rb-tree-dnd.sgml | 14 +++---- doc/reference/tmpl/rhythmbox-unused.sgml | 44 +++++++++++++++++++ doc/reference/tmpl/rhythmdb.sgml | 15 ------- metadata/sj-error.c | 8 ++-- metadata/sj-error.h | 4 +- metadata/sj-metadata-musicbrainz.c | 72 +++++++++++++++----------------- metadata/sj-metadata-musicbrainz.h | 4 +- metadata/sj-metadata.c | 6 +-- metadata/sj-metadata.h | 4 +- metadata/sj-structures.c | 4 +- metadata/sj-structures.h | 14 ++----- plugins/audioscrobbler/Makefile.am | 12 +++--- 19 files changed, 131 insertions(+), 127 deletions(-) diff --git a/ChangeLog b/ChangeLog index e708badd..3cf2f683 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,21 @@ 2006-12-12 James Livingston + * plugins/audioscrobbler/Makefile.am: + * metadata/sj-error.c: (sj_error_quark): + * metadata/sj-error.h: + * metadata/sj-metadata-musicbrainz.c: + (sj_metadata_musicbrainz_instance_init), + (get_offline_track_listing), (cache_rdf), (get_cached_rdf), + (get_rdf), (lookup_cd): + * metadata/sj-metadata-musicbrainz.h: + * metadata/sj-metadata.c: (sj_metadata_get_type): + * metadata/sj-metadata.h: + * metadata/sj-structures.c: + * metadata/sj-structures.h: get bug fixes from S-J and hopefully fix + #382954. + +2006-12-12 James Livingston + * sources/rb-ipod-source.c: (rb_ipod_load_songs): hopefully fix some corrupt-ipod-db issues. from #358855 diff --git a/doc/reference/tmpl/rb-daap-share.sgml b/doc/reference/tmpl/rb-daap-share.sgml index 84a974d1..8b2e8c74 100644 --- a/doc/reference/tmpl/rb-daap-share.sgml +++ b/doc/reference/tmpl/rb-daap-share.sgml @@ -31,6 +31,7 @@ RBDAAPShare @name: @password: @db: +@entry_type: @playlist_manager: @Returns: diff --git a/doc/reference/tmpl/rb-daap-source.sgml b/doc/reference/tmpl/rb-daap-source.sgml index 8e306420..321e9a8d 100644 --- a/doc/reference/tmpl/rb-daap-source.sgml +++ b/doc/reference/tmpl/rb-daap-source.sgml @@ -23,32 +23,6 @@ RBDAAPSource - - - - - -@shell: -@Returns: - - - - - - - -@shell: - - - - - - - -@uri: -@Returns: - - diff --git a/doc/reference/tmpl/rb-debug.sgml b/doc/reference/tmpl/rb-debug.sgml index b4ba804c..050c6883 100644 --- a/doc/reference/tmpl/rb-debug.sgml +++ b/doc/reference/tmpl/rb-debug.sgml @@ -46,6 +46,8 @@ rb-debug @...: +@...: + @...: diff --git a/doc/reference/tmpl/rb-header.sgml b/doc/reference/tmpl/rb-header.sgml index 5bd28d21..70fc6cb1 100644 --- a/doc/reference/tmpl/rb-header.sgml +++ b/doc/reference/tmpl/rb-header.sgml @@ -29,6 +29,7 @@ rb-header @header: +@db: @Returns: @@ -42,15 +43,6 @@ rb-header @seekable: - - - - - -@header: -@title: - - diff --git a/doc/reference/tmpl/rb-shell.sgml b/doc/reference/tmpl/rb-shell.sgml index 8dde3de8..8a74abc5 100644 --- a/doc/reference/tmpl/rb-shell.sgml +++ b/doc/reference/tmpl/rb-shell.sgml @@ -150,6 +150,7 @@ rb-shell @primary: @icon: @secondary: +@requested: diff --git a/doc/reference/tmpl/rb-tray-icon.sgml b/doc/reference/tmpl/rb-tray-icon.sgml index aac5ef35..6b570274 100644 --- a/doc/reference/tmpl/rb-tray-icon.sgml +++ b/doc/reference/tmpl/rb-tray-icon.sgml @@ -55,6 +55,7 @@ rb-tray-icon @primary: @msgicon: @secondary: +@requested: diff --git a/doc/reference/tmpl/rb-tree-dnd.sgml b/doc/reference/tmpl/rb-tree-dnd.sgml index 5eb1675b..65105cf8 100644 --- a/doc/reference/tmpl/rb-tree-dnd.sgml +++ b/doc/reference/tmpl/rb-tree-dnd.sgml @@ -60,9 +60,9 @@ rb-tree-dnd @g_iface: -@row_draggable: -@drag_data_get: -@drag_data_delete: +@rb_row_draggable: +@rb_drag_data_get: +@rb_drag_data_delete: @@ -76,10 +76,10 @@ rb-tree-dnd @g_iface: -@drag_data_received: -@row_drop_possible: -@row_drop_position: -@get_drag_target: +@rb_drag_data_received: +@rb_row_drop_possible: +@rb_row_drop_position: +@rb_get_drag_target: diff --git a/doc/reference/tmpl/rhythmbox-unused.sgml b/doc/reference/tmpl/rhythmbox-unused.sgml index 219700f8..f9068ea6 100644 --- a/doc/reference/tmpl/rhythmbox-unused.sgml +++ b/doc/reference/tmpl/rhythmbox-unused.sgml @@ -358,6 +358,12 @@ + + + + + + @@ -531,6 +537,29 @@ @name: @Returns: + + + + + +@uri: +@Returns: + + + + + + +@shell: +@Returns: + + + + + + +@shell: + @@ -687,6 +716,14 @@ @player: @show: + + + + + +@header: +@title: + @@ -1020,6 +1057,13 @@ @Returns: + + + + + +@Returns: + diff --git a/doc/reference/tmpl/rhythmdb.sgml b/doc/reference/tmpl/rhythmdb.sgml index fb5aacee..0ce30aac 100644 --- a/doc/reference/tmpl/rhythmdb.sgml +++ b/doc/reference/tmpl/rhythmdb.sgml @@ -61,13 +61,6 @@ rhythmdb - - - - - - - @@ -595,14 +588,6 @@ rhythmdb @Returns: - - - - - -@Returns: - - diff --git a/metadata/sj-error.c b/metadata/sj-error.c index 3838f0cd..eab80c9c 100644 --- a/metadata/sj-error.c +++ b/metadata/sj-error.c @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2003 Ross Burton * * Sound Juicer - sj-error.c @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * Authors: Ross Burton */ @@ -25,9 +25,9 @@ #include "sj-error.h" GQuark -sj_error_quark (void) +sj_error_quark (void) { - static GQuark q = 0; + static GQuark q = 0; if (q == 0) { q = g_quark_from_static_string ("sj-error-quark"); } diff --git a/metadata/sj-error.h b/metadata/sj-error.h index 84eef202..c3e456de 100644 --- a/metadata/sj-error.h +++ b/metadata/sj-error.h @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2003 Ross Burton * * Sound Juicer - sj-error.h @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * Authors: Ross Burton */ diff --git a/metadata/sj-metadata-musicbrainz.c b/metadata/sj-metadata-musicbrainz.c index bb88a5d4..45d82b7f 100644 --- a/metadata/sj-metadata-musicbrainz.c +++ b/metadata/sj-metadata-musicbrainz.c @@ -14,11 +14,13 @@ * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301 USA. + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif /* HAVE_CONFIG_H */ #include #include @@ -28,22 +30,13 @@ #include #include #include -#include #include #include #include +#include #include #include -#include -#ifndef NAUTILUS_BURN_CHECK_VERSION -#define NAUTILUS_BURN_CHECK_VERSION(a,b,c) FALSE -#endif - -#if NAUTILUS_BURN_CHECK_VERSION(2,15,3) -#include -#endif - #include "sj-metadata-musicbrainz.h" #include "sj-structures.h" #include "sj-error.h" @@ -120,17 +113,20 @@ sj_metadata_musicbrainz_instance_init (GTypeInstance *instance, gpointer g_class mb_SetServer (self->priv->mb, server_name, 80); g_free (server_name); } - + /* Set the HTTP proxy */ if (gconf_client_get_bool (gconf_client, GCONF_PROXY_USE_PROXY, NULL)) { - mb_SetProxy (self->priv->mb, - gconf_client_get_string (gconf_client, GCONF_PROXY_HOST, NULL), + char *proxy_host = gconf_client_get_string (gconf_client, GCONF_PROXY_HOST, NULL); + mb_SetProxy (self->priv->mb, proxy_host, gconf_client_get_int (gconf_client, GCONF_PROXY_PORT, NULL)); + g_free (proxy_host); if (gconf_client_get_bool (gconf_client, GCONF_PROXY_USE_AUTHENTICATION, NULL)) { #if HAVE_MB_SETPROXYCREDS - mb_SetProxyCreds (self->priv->mb, - gconf_client_get_string (gconf_client, GCONF_PROXY_USERNAME, NULL), - gconf_client_get_string (gconf_client, GCONF_PROXY_PASSWORD, NULL)); + char *username = gconf_client_get_string (gconf_client, GCONF_PROXY_USERNAME, NULL); + char *password = gconf_client_get_string (gconf_client, GCONF_PROXY_PASSWORD, NULL); + mb_SetProxyCreds (self->priv->mb, username, password); + g_free (username); + g_free (password); #else g_warning ("mb_SetProxyCreds() not found, no proxy authorisation possible."); #endif @@ -139,7 +135,7 @@ sj_metadata_musicbrainz_instance_init (GTypeInstance *instance, gpointer g_class g_object_unref (gconf_client); - if (g_getenv ("MUSICBRAINZ_DEBUG")) { + if (g_getenv("MUSICBRAINZ_DEBUG")) { mb_SetDebug (self->priv->mb, TRUE); } } @@ -231,7 +227,7 @@ get_offline_track_listing(SjMetadata *metadata, GError **error) _("Cannot read CD: %s"), message); return NULL; } - + num_tracks = mb_GetResultInt (priv->mb, MBE_TOCGetLastTrack); album = g_new0 (AlbumDetails, 1); @@ -360,7 +356,7 @@ cache_rdf (musicbrainz_t mb, const char *filename) path = g_path_get_dirname (filename); g_mkdir_with_parents (path, 0755); /* Handle errors in set_contents() */ g_free (path); - + /* How much data is there to save? */ len = mb_GetResultRDFLen (mb); rdf = g_malloc0 (len); @@ -391,18 +387,18 @@ get_cached_rdf (musicbrainz_t mb, const char *cachepath) if (!g_file_test (cachepath, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) goto done; - + /* Cache file exists, open it */ if (!g_file_get_contents (cachepath, &rdf, NULL, &error)) { g_warning ("Cannot open cache file %s: %s", cachepath, error->message); g_error_free (error); goto done; } - + /* Set the RDF */ if (mb_SetResultRDF (mb, rdf)) ret = TRUE; - + done: g_free (rdf); return ret; @@ -451,7 +447,7 @@ get_rdf (SjMetadata *metadata) cachepath = g_build_filename (g_get_home_dir (), ".gnome2", "sound-juicer", "cache", cdindex, NULL); #endif - + if (!get_cached_rdf (priv->mb, cachepath)) { /* Don't re-use the CD Index as that doesn't send enough data to the server. By doing this we also pass track lengths, which can be proxied to FreeDB @@ -463,7 +459,7 @@ get_rdf (SjMetadata *metadata) } cache_rdf (priv->mb, cachepath); } - + done: g_free (cachepath); g_free (cdindex); @@ -479,9 +475,8 @@ lookup_cd (SjMetadata *metadata) char data[256]; int num_albums, i, j; NautilusBurnMediaType type; -#if NAUTILUS_BURN_CHECK_VERSION(2,15,3) + NautilusBurnDriveMonitor *monitor; NautilusBurnDrive *drive; -#endif /* TODO: fire error signal */ g_return_val_if_fail (metadata != NULL, NULL); @@ -490,17 +485,16 @@ lookup_cd (SjMetadata *metadata) g_return_val_if_fail (priv->cdrom != NULL, NULL); priv->error = NULL; /* TODO: hack */ -#if NAUTILUS_BURN_CHECK_VERSION(2,15,3) - drive = nautilus_burn_drive_monitor_get_drive_for_device (nautilus_burn_get_drive_monitor (), - priv->cdrom); + if (! nautilus_burn_initialized ()) { + nautilus_burn_init (); + } + monitor = nautilus_burn_get_drive_monitor (); + drive = nautilus_burn_drive_monitor_get_drive_for_device (monitor, priv->cdrom); if (drive == NULL) { return NULL; } type = nautilus_burn_drive_get_media_type (drive); nautilus_burn_drive_unref (drive); -#else - type = nautilus_burn_drive_get_media_type_from_path (priv->cdrom); -#endif if (type == NAUTILUS_BURN_MEDIA_TYPE_ERROR) { char *msg; @@ -548,12 +542,12 @@ lookup_cd (SjMetadata *metadata) if (g_ascii_strncasecmp (MBI_VARIOUS_ARTIST_ID, data, 64) == 0) { album->artist = g_strdup (_("Various")); } else { - if (data && mb_GetResultData1(priv->mb, MBE_AlbumGetArtistName, data, sizeof (data), 1)) { + if (*data && mb_GetResultData1(priv->mb, MBE_AlbumGetArtistName, data, sizeof (data), 1)) { album->artist = g_strdup (data); } else { album->artist = g_strdup (_("Unknown Artist")); } - if (data && mb_GetResultData1(priv->mb, MBE_AlbumGetArtistSortName, data, sizeof (data), 1)) { + if (*data && mb_GetResultData1(priv->mb, MBE_AlbumGetArtistSortName, data, sizeof (data), 1)) { album->artist_sortname = g_strdup (data); } } @@ -630,7 +624,7 @@ lookup_cd (SjMetadata *metadata) if (mb_GetResultData1(priv->mb, MBE_AlbumGetTrackDuration, data, sizeof (data), j)) { track->duration = atoi (data) / 1000; } - + album->tracks = g_list_append (album->tracks, track); album->number++; } @@ -648,12 +642,12 @@ lookup_cd (SjMetadata *metadata) mb_Query (priv->mb, MBQ_GetCDTOC); for (al = albums; al; al = al->next) { AlbumDetails *album = al->data; - + j = 1; for (tl = album->tracks; tl; tl = tl->next) { TrackDetails *track = tl->data; int sectors; - + if (track->duration == 0) { sectors = mb_GetResultInt1 (priv->mb, MBE_TOCGetTrackNumSectors, j+1); track->duration = get_duration_from_sectors (sectors); diff --git a/metadata/sj-metadata-musicbrainz.h b/metadata/sj-metadata-musicbrainz.h index 7ebc5e46..4d1344c3 100644 --- a/metadata/sj-metadata-musicbrainz.h +++ b/metadata/sj-metadata-musicbrainz.h @@ -14,8 +14,8 @@ * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301 USA. + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. */ #ifndef SJ_METADATA_MUSICBRAINZ_H diff --git a/metadata/sj-metadata.c b/metadata/sj-metadata.c index 98e841d0..eba3066c 100644 --- a/metadata/sj-metadata.c +++ b/metadata/sj-metadata.c @@ -14,8 +14,8 @@ * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301 USA. + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. */ #include @@ -62,7 +62,7 @@ sj_metadata_get_type (void) NULL, NULL }; - + type = g_type_register_static (G_TYPE_INTERFACE, "SjMetadata", &info, 0); g_type_interface_add_prerequisite (type, G_TYPE_OBJECT); } diff --git a/metadata/sj-metadata.h b/metadata/sj-metadata.h index 8f8419bf..89eb5ca4 100644 --- a/metadata/sj-metadata.h +++ b/metadata/sj-metadata.h @@ -14,8 +14,8 @@ * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301 USA. + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. */ #ifndef SJ_METADATA_H diff --git a/metadata/sj-structures.c b/metadata/sj-structures.c index 8acebc30..331c08af 100644 --- a/metadata/sj-structures.c +++ b/metadata/sj-structures.c @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2003 Ross Burton * * Sound Juicer - sj-structures.c @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * Authors: Ross Burton */ diff --git a/metadata/sj-structures.h b/metadata/sj-structures.h index 0c44547e..7c9a5e8d 100644 --- a/metadata/sj-structures.h +++ b/metadata/sj-structures.h @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2003 Ross Burton * * Sound Juicer - sj-structures.h @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * Authors: Ross Burton */ @@ -29,25 +29,19 @@ typedef struct _AlbumDetails AlbumDetails; typedef struct _TrackDetails TrackDetails; + struct _TrackDetails { AlbumDetails *album; int number; /* track number */ char *title; char *artist; - char* artist_sortname; + char* artist_sortname; /* Can be NULL, so fall back onto artist */ int duration; /* seconds */ char* track_id; char* artist_id; GtkTreeIter iter; /* Temporary iterator for internal use */ }; -struct _Date { - /* TODO: use GLib date structures? */ - guint year; - guint month; - guint day; -}; - struct _AlbumDetails { char* title; char* artist; diff --git a/plugins/audioscrobbler/Makefile.am b/plugins/audioscrobbler/Makefile.am index 8c6d18e2..38ca9a2e 100644 --- a/plugins/audioscrobbler/Makefile.am +++ b/plugins/audioscrobbler/Makefile.am @@ -50,14 +50,14 @@ BUILT_SOURCES = \ $(plugin_in_files:.rb-plugin.desktop.in=.rb-plugin) \ $(NULL) -plugin_DATA = \ - $(BUILT_SOURCES) \ - audioscrobbler-ui.xml \ +plugin_DATA = \ + $(BUILT_SOURCES) \ + $(top_srcdir)/plugins/audioscrobbler/audioscrobbler-ui.xml \ $(NULL) -EXTRA_DIST = \ - $(plugin_in_files) \ - as-powered.png \ +EXTRA_DIST = \ + $(plugin_in_files) \ + $(top_srcdir)/plugins/audioscrobbler/as-powered.png \ $(NULL) CLEANFILES = \ -- 2.11.4.GIT