From 7696dbdb6c0fd7a0da221ec504382ee1fb79969a Mon Sep 17 00:00:00 2001 From: Jens Georg Date: Thu, 17 Sep 2009 12:44:59 +0200 Subject: [PATCH] media-export: Do not try to re-add container to db --- src/plugins/media-export/rygel-media-export-harvester.vala | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/plugins/media-export/rygel-media-export-harvester.vala b/src/plugins/media-export/rygel-media-export-harvester.vala index 985c829..8d98685 100644 --- a/src/plugins/media-export/rygel-media-export-harvester.vala +++ b/src/plugins/media-export/rygel-media-export-harvester.vala @@ -218,10 +218,14 @@ public class Rygel.MediaExportHarvester : GLib.Object { if (info.get_file_type () == FileType.DIRECTORY) { this.origin = file; monitor.monitor (file); - this.containers.push_tail (new DummyContainer (file, - this.parent)); + var container = new DummyContainer (file, this.parent); + this.containers.push_tail (container); + + int64 timestamp; + if (!this.media_db.exists (container.id, out timestamp)) { + this.media_db.save_object (container); + } - this.media_db.save_object (this.containers.peek_tail ()); Idle.add (this.on_idle); } else { string id; @@ -233,7 +237,9 @@ public class Rygel.MediaExportHarvester : GLib.Object { } } catch (Error err) { - warning ("Failed to harvest file %s", file.get_uri ()); + warning ("Failed to harvest file %s: %s", + file.get_uri (), + err.message); harvested (file); } } -- 2.7.4