diff options
author | Jens Georg <jensg@openismus.com> | 2012-12-11 21:37:21 +0100 |
---|---|---|
committer | Jens Georg <jensg@openismus.com> | 2012-12-12 19:23:52 +0100 |
commit | 402b5991ae94aa31d9bd58120660d582bfc47ef8 (patch) | |
tree | ff498a31447b624e5792c0405f2768abb98eecbb /src | |
parent | c80901afca296991e089174aa32c98d2bb436aef (diff) | |
download | rygel-402b5991ae94aa31d9bd58120660d582bfc47ef8.tar.gz |
media-export: Restore various update ids
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/media-export/rygel-media-export-dummy-container.vala | 10 | ||||
-rw-r--r-- | src/plugins/media-export/rygel-media-export-media-cache.vala | 27 |
2 files changed, 37 insertions, 0 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 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, |