[rygel] media-export: Partially revert 3b90050



commit 28e73d5e87300744f8c4f2808f859f161642ca4b
Author: Jens Georg <jensg openismus com>
Date:   Mon Mar 11 12:41:42 2013 +0100

    media-export: Partially revert 3b90050

 .../rygel-media-export-media-cache.vala            |   55 +-------------------
 1 files changed, 1 insertions(+), 54 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 92da986..f39d690 100644
--- a/src/plugins/media-export/rygel-media-export-media-cache.vala
+++ b/src/plugins/media-export/rygel-media-export-media-cache.vala
@@ -519,21 +519,6 @@ public class Rygel.MediaExport.MediaCache : Object {
     }
 
     // Private functions
-    private bool is_object_guarded (string id) {
-        try {
-            GLib.Value[] id_value = { id };
-
-            return this.query_value (SQLString.IS_GUARDED,
-                                     id_value) == 1;
-        } catch (DatabaseError error) {
-            warning ("Failed to get whether item %s is guarded: %s",
-                     id,
-                     error.message);
-
-            return false;
-        }
-    }
-
     private void get_exists_cache () throws DatabaseError {
         this.exists_cache = new HashMap<string, ExistsCacheEntry?> ();
         var cursor = this.exec_cursor (SQLString.EXISTS_CACHE);
@@ -663,38 +648,6 @@ public class Rygel.MediaExport.MediaCache : Object {
         this.db.exec (this.sql.make (SQLString.SAVE_METADATA), values);
     }
 
-    private void update_guarded_object (MediaObject object) throws Error {
-        int type = ObjectType.CONTAINER;
-        GLib.Value parent;
-
-        if (object is MediaItem) {
-            type = ObjectType.ITEM;
-        }
-
-        if (object.parent == null) {
-            parent = Database  null ();
-        } else {
-            parent = object.parent.id;
-        }
-
-        GLib.Value[] values = { object.id,
-                                type,
-                                parent,
-                                object.modified,
-                                object.uris.is_empty ? null : object.uris[0],
-                                object.object_update_id,
-                                -1,
-                                -1
-                              };
-        if (object is MediaContainer) {
-            var container = object as MediaContainer;
-            values[7] = container.total_deleted_child_count;
-            values[8] = container.update_id;
-        }
-
-        this.db.exec (this.sql.make (SQLString.UPDATE_GUARDED_OBJECT), values);
-    }
-
     private void create_normal_object (MediaObject object,
                                        bool is_guarded) throws Error {
         int type = ObjectType.CONTAINER;
@@ -735,13 +688,7 @@ public class Rygel.MediaExport.MediaCache : Object {
      */
     private void create_object (MediaObject object,
                                 bool override_guarded = false) throws Error {
-        var is_guarded = this.is_object_guarded (object.id);
-
-        if (!override_guarded && is_guarded) {
-            update_guarded_object (object);
-        } else {
-            create_normal_object (object, (is_guarded || override_guarded));
-        }
+        this.create_normal_object (object, false);
     }
 
     /**


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