From 0ef76e7f6573206d4e058390d8350685b5b2ee98 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Oct 20 2008 09:44:25 +0000 Subject: - Update to rev 5988, add patch to avoid duplicate tracks on iPods --- diff --git a/.cvsignore b/.cvsignore index 9f6eb1c..7b7ed1c 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -rhythmbox-0.11.6-r5966.tar.gz +rhythmbox-0.11.6-r5988.tar.gz diff --git a/rb-ipod-no-duplicates.patch b/rb-ipod-no-duplicates.patch new file mode 100644 index 0000000..31a903f --- /dev/null +++ b/rb-ipod-no-duplicates.patch @@ -0,0 +1,160 @@ +diff --git a/plugins/ipod/rb-ipod-source.c b/plugins/ipod/rb-ipod-source.c +index 3a52927..306044b 100644 +--- a/plugins/ipod/rb-ipod-source.c ++++ b/plugins/ipod/rb-ipod-source.c +@@ -77,6 +77,8 @@ static gboolean hal_udi_is_ipod (const char *udi); + + #ifdef ENABLE_IPOD_WRITING + static GList * impl_get_mime_types (RBRemovableMediaSource *source); ++static gboolean impl_should_paste (RBRemovableMediaSource *source, ++ RhythmDBEntry *entry); + static gboolean impl_track_added (RBRemovableMediaSource *source, + RhythmDBEntry *entry, + const char *dest, +@@ -158,6 +160,7 @@ rb_ipod_source_class_init (RBiPodSourceClass *klass) + + #ifdef ENABLE_IPOD_WRITING + source_class->impl_can_paste = (RBSourceFeatureFunc) rb_true_function; ++ rms_class->impl_should_paste = impl_should_paste; + rms_class->impl_track_added = impl_track_added; + rms_class->impl_build_dest_uri = impl_build_dest_uri; + rms_class->impl_get_mime_types = impl_get_mime_types; +@@ -1363,6 +1366,55 @@ add_to_podcasts (RBiPodSource *source, Itdb_Track *song) + } + + static gboolean ++impl_should_paste (RBRemovableMediaSource *source, ++ RhythmDBEntry *entry) ++{ ++ RhythmDBEntryType entry_type; ++ RhythmDB *db; ++ RBShell *shell; ++ const char *title; ++ const char *album; ++ const char *artist; ++ GtkTreeModel *query_model; ++ GtkTreeIter iter; ++ gboolean no_match; ++ ++ RBRemovableMediaSourceClass *rms_class = RB_REMOVABLE_MEDIA_SOURCE_CLASS (g_type_class_peek_parent (RB_REMOVABLE_MEDIA_SOURCE_GET_CLASS (source))); ++ /* chain up to parent impl */ ++ if (!rms_class->impl_should_paste (source, entry)) ++ return FALSE; ++ ++ g_object_get (source, "shell", &shell, "entry-type", &entry_type, NULL); ++ g_object_get (shell, "db", &db, NULL); ++ g_object_unref (shell); ++ ++ query_model = GTK_TREE_MODEL (rhythmdb_query_model_new_empty (db)); ++ title = rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_TITLE); ++ album = rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_ALBUM); ++ artist = rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_ARTIST); ++ rhythmdb_do_full_query (db, RHYTHMDB_QUERY_RESULTS (query_model), ++ RHYTHMDB_QUERY_PROP_EQUALS, ++ RHYTHMDB_PROP_TYPE, entry_type, ++ RHYTHMDB_QUERY_PROP_EQUALS, ++ RHYTHMDB_PROP_ARTIST, artist, ++ RHYTHMDB_QUERY_PROP_EQUALS, ++ RHYTHMDB_PROP_ALBUM, album, ++ RHYTHMDB_QUERY_PROP_EQUALS, ++ RHYTHMDB_PROP_TITLE, title, ++ RHYTHMDB_QUERY_END); ++ ++ no_match = (!gtk_tree_model_get_iter_first (GTK_TREE_MODEL (query_model), ++ &iter)); ++ g_boxed_free (RHYTHMDB_TYPE_ENTRY_TYPE, entry_type); ++ g_object_unref(query_model); ++ g_object_unref (db); ++ if (no_match == FALSE) { ++ rb_debug ("not adding %s - %s - %s to the ipod since it's already present\n", title, album, artist); ++ } ++ return no_match; ++} ++ ++static gboolean + impl_track_added (RBRemovableMediaSource *source, + RhythmDBEntry *entry, + const char *dest, +diff --git a/sources/rb-removable-media-source.c b/sources/rb-removable-media-source.c +index 3192d13..bd867f6 100644 +--- a/sources/rb-removable-media-source.c ++++ b/sources/rb-removable-media-source.c +@@ -68,6 +68,8 @@ static void impl_delete_thyself (RBSource *source); + static void impl_paste (RBSource *source, GList *entries); + #endif + static gboolean impl_receive_drag (RBSource *asource, GtkSelectionData *data); ++static gboolean impl_should_paste (RBRemovableMediaSource *source, ++ RhythmDBEntry *entry); + static guint impl_want_uri (RBSource *source, const char *uri); + static gboolean impl_uri_is_source (RBSource *source, const char *uri); + +@@ -118,6 +120,8 @@ rb_removable_media_source_class_init (RBRemovableMediaSourceClass *klass) + browser_source_class->impl_get_paned_key = NULL; + browser_source_class->impl_has_drop_support = (RBBrowserSourceFeatureFunc) rb_false_function; + ++ klass->impl_should_paste = impl_should_paste; ++ + g_object_class_install_property (object_class, + PROP_VOLUME, + g_param_spec_object ("volume", +@@ -363,7 +367,7 @@ impl_paste (RBSource *source, GList *entries) + entry_type = rhythmdb_entry_get_entry_type (entry); + + if (entry_type == our_entry_type || +- entry_type->category != RHYTHMDB_ENTRY_NORMAL) { ++ !rb_removable_media_source_should_paste (RB_REMOVABLE_MEDIA_SOURCE (source), entry)) { + goto impl_paste_end; + } + +@@ -634,6 +638,24 @@ rb_removable_media_source_get_mime_types (RBRemovableMediaSource *source) + return NULL; + } + ++static gboolean ++impl_should_paste (RBRemovableMediaSource *source, RhythmDBEntry *entry) ++{ ++ RhythmDBEntryType entry_type = rhythmdb_entry_get_entry_type (entry); ++ gboolean should_paste = (entry_type->category == RHYTHMDB_ENTRY_NORMAL); ++ g_boxed_free (RHYTHMDB_TYPE_ENTRY_TYPE, entry_type); ++ return should_paste; ++} ++ ++gboolean ++rb_removable_media_source_should_paste (RBRemovableMediaSource *source, ++ RhythmDBEntry *entry) ++{ ++ RBRemovableMediaSourceClass *klass = RB_REMOVABLE_MEDIA_SOURCE_GET_CLASS (source); ++ ++ return klass->impl_should_paste (source, entry); ++} ++ + void + rb_removable_media_source_track_added (RBRemovableMediaSource *source, + RhythmDBEntry *entry, +diff --git a/sources/rb-removable-media-source.h b/sources/rb-removable-media-source.h +index 763155b..3568205 100644 +--- a/sources/rb-removable-media-source.h ++++ b/sources/rb-removable-media-source.h +@@ -62,8 +62,13 @@ typedef struct + const char *uri, + guint64 filesize, + const char *mimetype); ++ gboolean (*impl_should_paste) (RBRemovableMediaSource *source, ++ RhythmDBEntry *entry); + } RBRemovableMediaSourceClass; + ++typedef gboolean (*RBRemovableMediaSourceShouldPasteFunc) (RBRemovableMediaSource *source, ++ RhythmDBEntry *entry); ++ + GType rb_removable_media_source_get_type (void); + + char* rb_removable_media_source_build_dest_uri (RBRemovableMediaSource *source, +@@ -76,6 +81,8 @@ void rb_removable_media_source_track_added (RBRemovableMediaSource *source, + guint64 filesize, + const char *mimetype); + GList * rb_removable_media_source_get_mime_types (RBRemovableMediaSource *source); ++gboolean rb_removable_media_source_should_paste (RBRemovableMediaSource *source, ++ RhythmDBEntry *entry); + + G_END_DECLS + diff --git a/rhythmbox.spec b/rhythmbox.spec index b82a6b4..b4170a1 100644 --- a/rhythmbox.spec +++ b/rhythmbox.spec @@ -3,12 +3,12 @@ Name: rhythmbox Summary: Music Management Application Version: 0.11.6 -Release: 13.5966%{?dist} +Release: 14.5988%{?dist} License: GPLv2+ with exceptions and GFDL Group: Applications/Multimedia URL: http://www.gnome.org/projects/rhythmbox/ #Source: http://download.gnome.org/sources/rhythmbox/0.11/%{name}-%{version}.tar.bz2 -Source: %{name}-%{version}-r5966.tar.gz +Source: %{name}-%{version}-r5988.tar.gz Source1: rhythmbox-iradio-initial.pls # http://bugzilla.gnome.org/show_bug.cgi?id=524079 Source2: rhythmbox.png @@ -53,6 +53,8 @@ ExcludeArch: s390 s390x # https://bugzilla.redhat.com/show_bug.cgi?id=428034 Patch0: rb-disable-power-plugin-by-default.patch +# http://bugzilla.gnome.org/show_bug.cgi?id=411634 +Patch1: rb-ipod-no-duplicates.patch %description Rhythmbox is an integrated music management application based on the powerful @@ -82,6 +84,7 @@ UPnP/DLNA network devices. %setup -q %patch0 -p0 -b .dont-disable-suspend +%patch1 -p1 -b .ipod-dupes %build @@ -214,6 +217,9 @@ fi %{_libdir}/rhythmbox/plugins/upnp_coherence %changelog +* Mon Oct 20 2008 - Bastien Nocera - 0.11.6-14.r5988 +- Update to rev 5988, add patch to avoid duplicate tracks on iPods + * Wed Oct 8 2008 Matthias Clasen - 0.11.6-13.r5966 - Save some space diff --git a/sources b/sources index 08b1b7d..64327d3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -8a2ccc546e24451a16fa1dc487278d83 rhythmbox-0.11.6-r5966.tar.gz +8a0a83e941356c3bb618d4bc7f28f869 rhythmbox-0.11.6-r5988.tar.gz