[rygel] media-export: Mark created item as place-holder
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] media-export: Mark created item as place-holder
- Date: Thu, 30 Aug 2012 18:17:44 +0000 (UTC)
commit 127244d6fdbafac74c87be4a47aa92e1cb5e0f4f
Author: Jens Georg <mail jensge org>
Date: Thu Aug 30 20:16:51 2012 +0200
media-export: Mark created item as place-holder
.../rygel-media-export-media-cache.vala | 4 ++++
.../rygel-media-export-writable-db-container.vala | 7 ++++++-
2 files changed, 10 insertions(+), 1 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 4d02c17..d55c9ae 100644
--- a/src/plugins/media-export/rygel-media-export-media-cache.vala
+++ b/src/plugins/media-export/rygel-media-export-media-cache.vala
@@ -639,6 +639,10 @@ public class Rygel.MediaExport.MediaCache : Object {
if (object != null) {
object.modified = statement.column_int64 (DetailColumn.TIMESTAMP);
+ if (object.modified == int64.MAX && object is MediaItem) {
+ object.modified = 0;
+ (object as MediaItem).place_holder = true;
+ }
}
return object;
diff --git a/src/plugins/media-export/rygel-media-export-writable-db-container.vala b/src/plugins/media-export/rygel-media-export-writable-db-container.vala
index 9330c7a..b4db6dc 100644
--- a/src/plugins/media-export/rygel-media-export-writable-db-container.vala
+++ b/src/plugins/media-export/rygel-media-export-writable-db-container.vala
@@ -39,7 +39,12 @@ internal class Rygel.MediaExport.WritableDbContainer : DBContainer,
public async void add_item (Rygel.MediaItem item, Cancellable? cancellable)
throws Error {
item.parent = this;
- item.id = MediaCache.get_id (File.new_for_uri (item.uris[0]));
+ var file = File.new_for_uri (item.uris[0]);
+ // TODO: Mark as place-holder. Make this proper some time.
+ if (file.is_native ()) {
+ item.modified = int64.MAX;
+ }
+ item.id = MediaCache.get_id (file);
this.media_db.save_item (item);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]