[rygel] server: Implement totalDeletedChildCount



commit 0e4e9e8af43f7845c65a1d2c3650142fdae64e95
Author: Jens Georg <jensg openismus com>
Date:   Sun Oct 21 17:14:29 2012 +0200

    server: Implement totalDeletedChildCount

 src/librygel-server/rygel-media-container.vala |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/src/librygel-server/rygel-media-container.vala b/src/librygel-server/rygel-media-container.vala
index 5d8ee2b..0450db9 100644
--- a/src/librygel-server/rygel-media-container.vala
+++ b/src/librygel-server/rygel-media-container.vala
@@ -88,6 +88,10 @@ public abstract class Rygel.MediaContainer : MediaObject {
     public uint32 update_id;
     public int64 storage_used;
 
+    // This is a uint32 in UPnP. SystemUpdateID should reach uint32.MAX way
+    // before this variable and cause a SystemResetProcedure.
+    public int64 total_deleted_child_count;
+
     public string sort_criteria { set; get; default = DEFAULT_SORT_CRITERIA; }
 
     internal override OCMFlags ocm_flags {
@@ -131,6 +135,7 @@ public abstract class Rygel.MediaContainer : MediaObject {
         this.child_count = child_count;
         this.update_id = 0;
         this.storage_used = -1;
+        this.total_deleted_child_count = 0;
         this.upnp_class = STORAGE_FOLDER;
 
         this.container_updated.connect (on_container_updated);
@@ -200,8 +205,12 @@ public abstract class Rygel.MediaContainer : MediaObject {
         didl_container.upnp_class = this.upnp_class;
         didl_container.searchable = this is SearchableContainer;
         didl_container.storage_used = this.storage_used;
-        didl_container.container_update_id = this.update_id;
-        didl_container.update_id = this.object_update_id;
+        if (this is TrackableContainer) {
+            didl_container.container_update_id = this.update_id;
+            didl_container.update_id = this.object_update_id;
+            didl_container.total_deleted_child_count =
+                                        (uint) this.total_deleted_child_count;
+        }
 
         if (this.parent == null && (this is SearchableContainer)) {
             (this as SearchableContainer).serialize_search_parameters



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