[rygel] media-export: Fix child-count if only folders are harvested



commit efae4daca580e5eb7b721cb72c4a052bd7cf145d
Author: Jens Georg <jensg openismus com>
Date:   Tue Apr 9 12:51:27 2013 +0200

    media-export: Fix child-count if only folders are harvested

 .../rygel-media-export-harvesting-task.vala        |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-harvesting-task.vala 
b/src/plugins/media-export/rygel-media-export-harvesting-task.vala
index ba38a24..d693f6d 100644
--- a/src/plugins/media-export/rygel-media-export-harvesting-task.vala
+++ b/src/plugins/media-export/rygel-media-export-harvesting-task.vala
@@ -180,12 +180,13 @@ public class Rygel.MediaExport.HarvestingTask : Rygel.StateMachine,
 
             var container = new DummyContainer (file, parent);
             this.containers.push_tail (container);
-            try {
-                this.cache.save_container (container);
-            } catch (Error err) {
-                warning (_("Failed to update database: %s"), err.message);
 
-                return false;
+            // Only add new containers. There's not much about a container so
+            // we skip the updated signal
+            var dummy_parent = parent as DummyContainer;
+            if (dummy_parent != null &&
+                dummy_parent.children.contains (MediaCache.get_id (file))) {
+                dummy_parent.add_child_tracked.begin (container);
             }
 
             return true;
@@ -210,8 +211,8 @@ public class Rygel.MediaExport.HarvestingTask : Rygel.StateMachine,
         foreach (var info in list) {
             var file = container.file.get_child (info.get_name ());
 
-            container.seen (file);
             this.process_file (file, info, container);
+            container.seen (file);
         }
 
         return true;


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