[rygel/wip/create-container: 4/5] wip



commit f05826bb3f2741146a372e016dc98242c891ea39
Author: Jens Georg <jensg openismus com>
Date:   Sat Feb 23 12:40:16 2013 +0100

    wip

 src/librygel-server/rygel-item-creator.vala |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/librygel-server/rygel-item-creator.vala b/src/librygel-server/rygel-item-creator.vala
index e33b6e7..c589566 100644
--- a/src/librygel-server/rygel-item-creator.vala
+++ b/src/librygel-server/rygel-item-creator.vala
@@ -36,7 +36,7 @@ internal class Rygel.ItemCreator: GLib.Object, Rygel.StateMachine {
     private string container_id;
     private string elements;
 
-    private DIDLLiteItem didl_item;
+    private DIDLLiteObject didl_item;
     private MediaItem item;
 
     private ContentDirectory content_dir;
@@ -136,7 +136,9 @@ internal class Rygel.ItemCreator: GLib.Object, Rygel.StateMachine {
      * according to UPnP and DLNA guidelines.
      */
     private void parse_didl () throws Error {
-        this.didl_parser.item_available.connect ((didl_item) => {
+        // FIXME: This will take the last object in the DIDL-Lite, maybe we
+        // should limit it to one somehow.
+        this.didl_parser.object_available.connect ((didl_item) => {
             this.didl_item = didl_item;
         });
 
@@ -177,7 +179,7 @@ internal class Rygel.ItemCreator: GLib.Object, Rygel.StateMachine {
 
         if (didl_item.upnp_class == null ||
             didl_item.upnp_class == "" ||
-            !didl_item.upnp_class.has_prefix ("object.item")) {
+            !didl_item.upnp_class.has_prefix ("object")) {
             throw new ContentDirectoryError.BAD_METADATA
                                         ("Invalid upnp:class given ");
         }
@@ -449,6 +451,8 @@ internal class Rygel.ItemCreator: GLib.Object, Rygel.StateMachine {
             return new MusicItem (id, parent, title);
         case PlaylistItem.UPNP_CLASS:
             return new PlaylistItem (id, parent, title);
+        case MediaContainer.STORAGE_FOLDER:
+            return new MediaContainer (id, parent, title);
         default:
             throw new ContentDirectoryError.BAD_METADATA
                                         ("Creation of item of class '%s' " +


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