Check only prefix of MediaItem.upnp_class.
authorZeeshan Ali (Khattak) <zeeshanak@src.gnome.org>
Tue, 13 Jan 2009 14:32:59 +0000 (14:32 +0000)
committerZeeshan Ali (Khattak) <zeeshanak@src.gnome.org>
Tue, 13 Jan 2009 14:32:59 +0000 (14:32 +0000)
svn path=/trunk/; revision=430

src/rygel/rygel-media-item.vala
src/rygel/rygel-streamer.vala

index 4951032..f1d8071 100644 (file)
@@ -87,12 +87,12 @@ public class Rygel.MediaItem : MediaObject {
                                     null,
                                     this.author);
 
-            if (this.upnp_class == VIDEO_CLASS) {
+            if (this.upnp_class.has_prefix (VIDEO_CLASS)) {
                 didl_writer.add_string ("author",
                                         DIDLLiteWriter.NAMESPACE_UPNP,
                                         null,
                                         this.author);
-            } else if (this.upnp_class == MUSIC_CLASS) {
+            } else if (this.upnp_class.has_prefix (MUSIC_CLASS)) {
                 didl_writer.add_string ("artist",
                                         DIDLLiteWriter.NAMESPACE_UPNP,
                                         null,
@@ -130,7 +130,7 @@ public class Rygel.MediaItem : MediaObject {
 
         this.res.dlna_profile = "MP3"; /* FIXME */
 
-        if (this.upnp_class == MediaItem.IMAGE_CLASS) {
+        if (this.upnp_class.has_prefix (MediaItem.IMAGE_CLASS)) {
             this.res.dlna_flags |= GUPnP.DLNAFlags.INTERACTIVE_TRANSFER_MODE;
         } else {
             this.res.dlna_flags |= GUPnP.DLNAFlags.STREAMING_TRANSFER_MODE;
index b31f3ad..6f17a1c 100644 (file)
@@ -154,7 +154,7 @@ public class Rygel.Streamer : GLib.Object {
             return;
         }
 
-        if (item.upnp_class == MediaItem.IMAGE_CLASS) {
+        if (item.upnp_class.has_prefix (MediaItem.IMAGE_CLASS)) {
             this.handle_interactive_item (msg, item, seek);
         } else {
             this.handle_streaming_item (msg, item, seek);