rpms/rhythmbox/devel rb-ipod-no-duplicates.patch, NONE, 1.1 .cvsignore, 1.38, 1.39 rhythmbox.spec, 1.211, 1.212 sources, 1.40, 1.41

Bastien Nocera hadess at fedoraproject.org
Mon Oct 20 09:44:55 UTC 2008


Author: hadess

Update of /cvs/pkgs/rpms/rhythmbox/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv17904

Modified Files:
	.cvsignore rhythmbox.spec sources 
Added Files:
	rb-ipod-no-duplicates.patch 
Log Message:
* Mon Oct 20 2008 - Bastien Nocera <bnocera at redhat.com> - 0.11.6-14.r5988
- Update to rev 5988, add patch to avoid duplicate tracks on iPods


rb-ipod-no-duplicates.patch:

--- NEW FILE rb-ipod-no-duplicates.patch ---
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
 


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/rhythmbox/devel/.cvsignore,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- .cvsignore	3 Oct 2008 16:34:17 -0000	1.38
+++ .cvsignore	20 Oct 2008 09:44:24 -0000	1.39
@@ -1 +1 @@
-rhythmbox-0.11.6-r5966.tar.gz
+rhythmbox-0.11.6-r5988.tar.gz


Index: rhythmbox.spec
===================================================================
RCS file: /cvs/pkgs/rpms/rhythmbox/devel/rhythmbox.spec,v
retrieving revision 1.211
retrieving revision 1.212
diff -u -r1.211 -r1.212
--- rhythmbox.spec	9 Oct 2008 03:48:39 -0000	1.211
+++ rhythmbox.spec	20 Oct 2008 09:44:25 -0000	1.212
@@ -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 @@
 
 # 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 @@
 %setup -q
 
 %patch0 -p0 -b .dont-disable-suspend
+%patch1 -p1 -b .ipod-dupes
 
 %build
 
@@ -214,6 +217,9 @@
 %{_libdir}/rhythmbox/plugins/upnp_coherence
 
 %changelog
+* Mon Oct 20 2008 - Bastien Nocera <bnocera at redhat.com> - 0.11.6-14.r5988
+- Update to rev 5988, add patch to avoid duplicate tracks on iPods
+
 * Wed Oct  8 2008 Matthias Clasen  <mclasen at redhat.com> - 0.11.6-13.r5966
 - Save some space
 


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/rhythmbox/devel/sources,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- sources	3 Oct 2008 16:34:17 -0000	1.40
+++ sources	20 Oct 2008 09:44:25 -0000	1.41
@@ -1 +1 @@
-8a2ccc546e24451a16fa1dc487278d83  rhythmbox-0.11.6-r5966.tar.gz
+8a0a83e941356c3bb618d4bc7f28f869  rhythmbox-0.11.6-r5988.tar.gz




More information about the scm-commits mailing list