[rygel] media-export: No need to build whole ancestry



commit 6cbbfed03075e47976178e95e9e1913728af1807
Author: Jens Georg <mail jensge org>
Date:   Sun Jun 6 22:16:59 2010 +0200

    media-export: No need to build whole ancestry
    
    For search we don't need the whole tree so we use a fake parent
    container, as only the ID is needed.

 .../rygel-media-export-media-cache.vala            |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-media-cache.vala b/src/plugins/media-export/rygel-media-export-media-cache.vala
index 4ebc7f2..14eef40 100644
--- a/src/plugins/media-export/rygel-media-export-media-cache.vala
+++ b/src/plugins/media-export/rygel-media-export-media-cache.vala
@@ -458,7 +458,6 @@ public class Rygel.MediaExport.MediaCache : Object {
         args.append (v);
         v = max_count;
         args.append (v);
-        var last_parent = "";
         MediaContainer parent = null;
 
         debug ("Parameters to bind: %u", args.n_values);
@@ -467,9 +466,9 @@ public class Rygel.MediaExport.MediaCache : Object {
             var child_id = statement.column_text (17);
             var parent_id = statement.column_text (18);
             try {
-                if (parent_id != last_parent) {
-                    parent = get_object (parent_id) as MediaContainer;
-                    last_parent = parent_id;
+                if (parent == null || parent_id != parent.id) {
+                    parent = new NullContainer ();
+                    parent.id = parent_id;
                 }
 
                 if (parent != null) {



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