[rhythmbox] Fix sharing to iTunes 10



commit 48e288b70403ead0c908fd616111b3a2312a14d1
Author: W. Michael Petullo <mike flyn org>
Date:   Thu Sep 9 12:12:38 2010 -0500

    Fix sharing to iTunes 10
    
    iTunes 10 is more picky about com.apple.itunes.mediakind. If it is
    requested, it must be present in the response. This patch fixes serving
    to iTunes 10.
    Signed-off-by: W. Michael Petullo <mike flyn org>

 configure.ac                  |    8 +-------
 plugins/daap/rb-daap-record.c |   10 ++++++++++
 2 files changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 88e986b..d80adf7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -793,15 +793,9 @@ AC_ARG_ENABLE(daap,
                              [Disable DAAP support]),,
               enable_daap=auto)
 if test "x$enable_daap" != "xno"; then
-	PKG_CHECK_MODULES(DMAPSHARING, libdmapsharing-2.0,
+	PKG_CHECK_MODULES(DMAPSHARING, libdmapsharing-2.0 >= 2.0.3,
 			  have_libdmapsharing=yes,
 			  have_libdmapsharing=no)
-	if test "x$have_libdmapsharing" = "xno"; then
-		PKG_CHECK_MODULES(DMAPSHARING, libdmapsharing-1.9 >= 1.9.0.21,
-				  have_libdmapsharing=yes,
-				  have_libdmapsharing=no)
-	fi
-
 	if test "x$have_libdmapsharing" = "xno" -a "x$enable_daap" = "xyes"; then
 		AC_MSG_ERROR([DAAP support explicitly requested, but libdmapsharing couldn't be found])
 	fi
diff --git a/plugins/daap/rb-daap-record.c b/plugins/daap/rb-daap-record.c
index e995b90..eccfafe 100644
--- a/plugins/daap/rb-daap-record.c
+++ b/plugins/daap/rb-daap-record.c
@@ -38,6 +38,7 @@
 struct RBDAAPRecordPrivate {
 	guint64 filesize;
 	char *location;
+	int mediakind;
 	char *format;	 /* Format, possibly after transcoding. */
 	char *real_format;
 	char *title;
@@ -66,6 +67,7 @@ enum {
 	PROP_ALBUM,
 	PROP_ARTIST,
 	PROP_GENRE,
+	PROP_MEDIAKIND,
 	PROP_FORMAT,
 	PROP_DURATION,
 	PROP_TRACK,
@@ -111,6 +113,9 @@ rb_daap_record_set_property (GObject *object,
 			g_free (record->priv->genre);
 			record->priv->genre = g_value_dup_string (value);
 			break;
+		case PROP_MEDIAKIND:
+			record->priv->mediakind = g_value_get_int (value);
+			break;
 		case PROP_FORMAT:
 			g_free (record->priv->format);
 			record->priv->format = g_value_dup_string (value);
@@ -187,6 +192,9 @@ rb_daap_record_get_property (GObject *object,
 		case PROP_GENRE:
 			g_value_set_string (value, record->priv->genre);
 			break;
+		case PROP_MEDIAKIND:
+			g_value_set_int (value, record->priv->mediakind);
+			break;
 		case PROP_FORMAT:
 			g_value_set_string (value, record->priv->format);
 			break;
@@ -282,6 +290,7 @@ rb_daap_record_class_init (RBDAAPRecordClass *klass)
 	g_object_class_override_property (gobject_class, PROP_ALBUM, "daap.songalbum");
 	g_object_class_override_property (gobject_class, PROP_ARTIST, "daap.songartist");
 	g_object_class_override_property (gobject_class, PROP_GENRE, "daap.songgenre");
+	g_object_class_override_property (gobject_class, PROP_MEDIAKIND, "mediakind");
 	g_object_class_override_property (gobject_class, PROP_FORMAT, "format");
 	g_object_class_override_property (gobject_class, PROP_RATING, "rating");
 	g_object_class_override_property (gobject_class, PROP_FILESIZE, "filesize");
@@ -380,6 +389,7 @@ RBDAAPRecord *rb_daap_record_new (RhythmDBEntry *entry)
 		} else {
 			ext++;
 		}
+		record->priv->mediakind = DMAP_MEDIA_KIND_MUSIC;
 		record->priv->real_format = g_strdup (ext);
 		record->priv->format = g_strdup (record->priv->real_format);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]