rygel r485 - trunk/src/plugins/tracker



Author: zeeshanak
Date: Wed Jan 28 12:32:34 2009
New Revision: 485
URL: http://svn.gnome.org/viewvc/rygel?rev=485&view=rev

Log:
MediaTracker serializes the children rather than TrackerContainer.

Modified:
   trunk/src/plugins/tracker/rygel-media-tracker.vala
   trunk/src/plugins/tracker/rygel-tracker-container.vala

Modified: trunk/src/plugins/tracker/rygel-media-tracker.vala
==============================================================================
--- trunk/src/plugins/tracker/rygel-media-tracker.vala	(original)
+++ trunk/src/plugins/tracker/rygel-media-tracker.vala	Wed Jan 28 12:32:34 2009
@@ -85,11 +85,19 @@
         if (container == null)
             args.number_returned = 0;
         else {
-            args.number_returned =
-                container.add_children_from_db (didl_writer,
-                                                args.index,
-                                                args.requested_count,
-                                                out args.total_matches);
+            ArrayList<MediaItem> children;
+
+            children = this.get_children (args.object_id,
+                                          args.index,
+                                          args.requested_count,
+                                          out args.total_matches);
+
+            /* Iterate through all items */
+            for (int i = 0; i < children.size; i++) {
+                children[i].serialize (didl_writer);
+            }
+
+            args.number_returned = children.size;
         }
 
         if (args.number_returned > 0) {
@@ -187,5 +195,20 @@
         if (container != null)
             item = container.get_item_from_db (item_id);
     }
+
+    private ArrayList<MediaObject> get_children (string   container_id,
+                                                 uint     offset,
+                                                 uint     max_count,
+                                                 out uint child_count)
+                                                 throws GLib.Error {
+        var container = this.find_container_by_id (container_id);
+        if (container == null) {
+            throw new ContentDirectoryError.NO_SUCH_OBJECT ("No such object");
+        }
+
+        return container.get_children_from_db (offset,
+                                               max_count,
+                                               out child_count);
+    }
 }
 

Modified: trunk/src/plugins/tracker/rygel-tracker-container.vala
==============================================================================
--- trunk/src/plugins/tracker/rygel-tracker-container.vala	(original)
+++ trunk/src/plugins/tracker/rygel-tracker-container.vala	Wed Jan 28 12:32:34 2009
@@ -114,26 +114,7 @@
         return count;
     }
 
-    public uint add_children_from_db (DIDLLiteWriter didl_writer,
-                                       uint           offset,
-                                       uint           max_count,
-                                       out uint       child_count)
-                                       throws GLib.Error {
-        ArrayList<MediaItem> children;
-
-        children = this.get_children_from_db (offset,
-                                              max_count,
-                                              out child_count);
-
-        /* Iterate through all items */
-        for (int i = 0; i < children.size; i++) {
-            children[i].serialize (didl_writer);
-        }
-
-        return children.size;
-    }
-
-    private ArrayList<MediaItem> get_children_from_db (
+    public ArrayList<MediaItem> get_children_from_db (
                                             uint     offset,
                                             uint     max_count,
                                             out uint child_count)



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