From 402b5991ae94aa31d9bd58120660d582bfc47ef8 Mon Sep 17 00:00:00 2001 From: Jens Georg Date: Tue, 11 Dec 2012 21:37:21 +0100 Subject: media-export: Restore various update ids --- .../rygel-media-export-dummy-container.vala | 10 ++++++++ .../rygel-media-export-media-cache.vala | 27 ++++++++++++++++++++++ 2 files changed, 37 insertions(+) (limited to 'src') 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 4e2f29f6..7942eb81 100644 --- a/src/plugins/media-export/rygel-media-export-dummy-container.vala +++ b/src/plugins/media-export/rygel-media-export-dummy-container.vala @@ -31,6 +31,16 @@ internal class Rygel.MediaExport.DummyContainer : TrackableDbContainer { } catch (Error error) { } base (cache, MediaCache.get_id (file), file.get_basename ()); + + uint32 object_update_id, container_update_id, total_deleted_child_count; + this.media_db.get_track_properties (this.id, + out object_update_id, + out container_update_id, + out total_deleted_child_count); + this.object_update_id = object_update_id; + this.update_id = container_update_id; + this.total_deleted_child_count = total_deleted_child_count; + this.parent_ref = parent; this.file = file; this.uris.add (file.get_uri ()); 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 8ba7c7d5..732cce52 100644 --- a/src/plugins/media-export/rygel-media-export-media-cache.vala +++ b/src/plugins/media-export/rygel-media-export-media-cache.vala @@ -163,6 +163,33 @@ public class Rygel.MediaExport.MediaCache : Object { return 0; } + public void get_track_properties (string id, + out uint32 object_update_id, + out uint32 container_update_id, + out uint32 total_deleted_child_count) { + GLib.Value[] values = { id }; + + object_update_id = 0; + container_update_id = 0; + total_deleted_child_count = 0; + + try { + var cursor = this.db.exec_cursor ("SELECT object_update_id, " + + "container_update_id, " + + "deleted_child_count " + + "FROM Object WHERE upnp_id = ?", + values); + var statement = cursor.next (); + object_update_id = (uint32) statement->column_int64 (0); + container_update_id = (uint32) statement->column_int64 (1); + total_deleted_child_count = (uint32) statement->column_int64 (2); + + return; + } catch (Error error) { + warning ("Failed to get update ids: %s", error.message); + } + + } public bool exists (File file, out int64 timestamp, -- cgit v1.2.1