[rygel] media-export: Simplify DummyContainer



commit 5abd17dddd3d83950cab9653fcbc07e2c0f70d0f
Author: Jens Georg <mail jensge org>
Date:   Wed Jul 28 12:48:23 2010 +0200

    media-export: Simplify DummyContainer

 .../rygel-media-export-dummy-container.vala        |   21 +++++++++++--------
 1 files changed, 12 insertions(+), 9 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-dummy-container.vala b/src/plugins/media-export/rygel-media-export-dummy-container.vala
index e4d28c3..249567d 100644
--- a/src/plugins/media-export/rygel-media-export-dummy-container.vala
+++ b/src/plugins/media-export/rygel-media-export-dummy-container.vala
@@ -21,22 +21,25 @@ using Gee;
 
 internal class Rygel.MediaExport.DummyContainer : NullContainer {
     public File file;
-    public ArrayList<string> seen_children;
+    public Gee.List<string> children;
 
-    public DummyContainer (File file, MediaContainer parent) {
-        var id = Checksum.compute_for_string (ChecksumType.MD5,
-                                              file.get_uri ());
-        this.id = id;
-        this.parent = parent;
+    public DummyContainer (File           file,
+                           MediaContainer parent) {
+        this.id = Item.get_id (file);
         this.title = file.get_basename ();
-        this.child_count = 0;
         this.parent_ref = parent;
         this.file = file;
         this.set_uri (file.get_uri ());
-        this.seen_children = new ArrayList<string> (str_equal);
+        try {
+            this.children = MediaCache.get_default ().get_child_ids (this.id);
+            this.child_count = this.children.size;
+        } catch (Error error) {
+            this.children = new ArrayList<string> ();
+            this.child_count = 0;
+        }
     }
 
     public void seen (string id) {
-        seen_children.add (id);
+        this.children.remove (id);
     }
 }



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