rpms/rhythmbox/devel rhythmbox-0.11.6-libmtp-0.3.patch, NONE, 1.1 rhythmbox.spec, 1.198, 1.199

Bastien Nocera (hadess) fedora-extras-commits at redhat.com
Tue Aug 12 15:38:12 UTC 2008


Author: hadess

Update of /cvs/pkgs/rpms/rhythmbox/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21935

Modified Files:
	rhythmbox.spec 
Added Files:
	rhythmbox-0.11.6-libmtp-0.3.patch 
Log Message:
* Tue Aug 12 2008 - Bastien Nocera <bnocera at redhat.com> 0.11.6-4
- Add patch for libmtp 0.3 support (#458388)


rhythmbox-0.11.6-libmtp-0.3.patch:

--- NEW FILE rhythmbox-0.11.6-libmtp-0.3.patch ---
diff --git a/plugins/mtpdevice/rb-mtp-source.c b/plugins/mtpdevice/rb-mtp-source.c
index e699e58..84346d4 100644
--- a/plugins/mtpdevice/rb-mtp-source.c
+++ b/plugins/mtpdevice/rb-mtp-source.c
@@ -329,6 +329,27 @@ add_mtp_track_to_db (RBMtpSource *source,
 		g_value_unset (&value);
 	}
 
+	/* Set playcount */
+	if (track->usecount != 0) {
+		GValue value = {0, };
+		g_value_init (&value, G_TYPE_ULONG);
+		g_value_set_ulong (&value, track->usecount);
+		rhythmdb_entry_set (RHYTHMDB (db), entry,
+					       RHYTHMDB_PROP_PLAY_COUNT,
+					       &value);
+		g_value_unset (&value);
+	}
+	/* Set rating */
+	if (track->rating != 0) {
+		GValue value = {0, };
+		g_value_init (&value, G_TYPE_DOUBLE);
+		g_value_set_double (&value, track->rating/20);
+		rhythmdb_entry_set (RHYTHMDB (db), entry,
+					       RHYTHMDB_PROP_RATING,
+					       &value);
+		g_value_unset (&value);
+	}
+
 	/* Set title */
 	entry_set_string_prop (RHYTHMDB (db), entry, RHYTHMDB_PROP_TITLE, track->title);
 
@@ -663,6 +684,8 @@ transfer_track (RBMtpSource *source,
 	}
 	trackmeta->tracknumber = rhythmdb_entry_get_ulong (entry, RHYTHMDB_PROP_TRACK_NUMBER);
 	trackmeta->duration = rhythmdb_entry_get_ulong (entry, RHYTHMDB_PROP_DURATION) * 1000;
+	trackmeta->rating = rhythmdb_entry_get_double (entry, RHYTHMDB_PROP_RATING) * 20;
+	trackmeta->usecount = rhythmdb_entry_get_ulong (entry, RHYTHMDB_PROP_PLAY_COUNT);
 	trackmeta->filesize = filesize;
 	if (mimetype == NULL) {
 		trackmeta->filetype = mimetype_to_filetype (rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_MIMETYPE));
diff -ur a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -154,6 +154,16 @@ if test "x$with_mtp" != "xno"; then
 	  fi
           if test "x$enable_hal" = xyes; then
 	     use_mtp=yes
+	     dnl Check for libmtp 0.3.0+
+	     OLD_MTP_CFLAGS=$MTP_CFLAGS
+	     OLD_MTP_LIBS=$MTP_LIBS
+	     PKG_CHECK_MODULES(MTP, libmtp >= 0.3.0, found_libmtp_030_pkg=yes, found_libmtp_030_pkg=no)
+	     if test x"$found_libmtp_030_pkg" = "xyes" ; then
+	     	AC_DEFINE([HAVE_LIBMTP_030], 1, [indicates whether libmtp 0.3.0 is installed])
+	     else
+	     	MTP_CFLAGS=$OLD_MTP_CFLAGS
+		MTP_LIBS=$OLD_MTP_LIBS
+	     fi
           fi
 	  AC_SUBST(MTP_CFLAGS)
 	  AC_SUBST(MTP_LIBS)
diff -ur a/plugins/mtpdevice/rb-mtp-source.c b/plugins/mtpdevice/rb-mtp-source.c
--- a/plugins/mtpdevice/rb-mtp-source.c
+++ b/plugins/mtpdevice/rb-mtp-source.c
@@ -670,7 +693,11 @@ transfer_track (RBMtpSource *source,
 		trackmeta->filetype = mimetype_to_filetype (mimetype);
 	}
 
+#ifdef HAVE_LIBMTP_030
+	if (LIBMTP_Send_Track_From_File (device, filename, trackmeta, NULL, NULL) != 0) {
+#else
 	if (LIBMTP_Send_Track_From_File (device, filename, trackmeta, NULL, NULL, 0) != 0) {
+#endif
 		LIBMTP_destroy_track_t (trackmeta);
 		rb_debug ("Tracktransfer failed\n");
 		return NULL;


Index: rhythmbox.spec
===================================================================
RCS file: /cvs/pkgs/rpms/rhythmbox/devel/rhythmbox.spec,v
retrieving revision 1.198
retrieving revision 1.199
diff -u -r1.198 -r1.199
--- rhythmbox.spec	27 Jul 2008 01:49:40 -0000	1.198
+++ rhythmbox.spec	12 Aug 2008 15:37:42 -0000	1.199
@@ -3,7 +3,7 @@
 Name: rhythmbox
 Summary: Music Management Application 
 Version: 0.11.6
-Release: 3%{?dist}
+Release: 4%{?dist}
 License: GPLv2+ and GFDL+
 Group: Applications/Multimedia
 URL: http://www.gnome.org/projects/rhythmbox/
@@ -49,6 +49,8 @@
 BuildRequires: perl(XML::Parser) intltool
 BuildRequires: xulrunner-devel
 
+BuildRequires: automake autoconf
+
 ExcludeArch:    s390 s390x
 
 # https://bugzilla.redhat.com/show_bug.cgi?id=428034
@@ -56,6 +58,9 @@
 # http://bugzilla.gnome.org/show_bug.cgi?id=374078
 # https://bugzilla.redhat.com/show_bug.cgi?id=440668
 Patch1: rhythmbox-0.11.5-ipod-vfat.patch
+# http://bugzilla.gnome.org/show_bug.cgi?id=546962
+# https://bugzilla.redhat.com/show_bug.cgi?id=458388
+Patch2: rhythmbox-0.11.6-libmtp-0.3.patch
 
 Patch10: rhythmbox-0.11.5-xfade-buffering.patch
 
@@ -91,10 +96,14 @@
 
 %patch0 -p0 -b .dont-disable-suspend
 %patch1 -p0 -b .ipod-vfat
+%patch2 -p1 -b .mtp
 %patch10 -p1 -b .xfade
 %patch23 -p1 -b .icon-names
 
 %build
+
+autoreconf
+
 # work around a gstreamer bug
 /usr/bin/gst-inspect-0.10 --print-all >& /dev/null || :
 
@@ -207,6 +216,9 @@
 %{_libdir}/rhythmbox/plugins/upnp_coherence
 
 %changelog
+* Tue Aug 12 2008 - Bastien Nocera <bnocera at redhat.com> 0.11.6-4
+- Add patch for libmtp 0.3 support (#458388)
+
 * Sat Jul 26 2008 Matthias Clasen  <mclasen at redhat.com> 0.11.6-3
 - Use standard icon names in a few places
 




More information about the fedora-extras-commits mailing list