[rygel] media-export: Fix a potential crasher
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [rygel] media-export: Fix a potential crasher
- Date: Mon, 12 Oct 2009 23:33:55 +0000 (UTC)
commit 73936b9eb6eba2137cc7979e022d258d34b8abdb
Author: Jens Georg <mail jensge org>
Date: Tue Oct 13 00:22:59 2009 +0200
media-export: Fix a potential crasher
This bug was triggered by a misconfiguration of XDG on Karmic which was
mapping Pictures, Videos and Music to $HOME. Now checking if a directory
is already scheduled for extraction.
.../rygel-media-export-root-container.vala | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-root-container.vala b/src/plugins/media-export/rygel-media-export-root-container.vala
index 2ba516f..7552564 100644
--- a/src/plugins/media-export/rygel-media-export-root-container.vala
+++ b/src/plugins/media-export/rygel-media-export-root-container.vala
@@ -208,13 +208,19 @@ public class Rygel.MediaExportRootContainer : Rygel.MediaDBContainer {
}
private void harvest (File file, MediaContainer parent = this) {
- var harvester = new MediaExportHarvester (parent,
- this.media_db,
- this.extractor,
- this.monitor);
- harvester.harvested.connect (this.on_file_harvested);
- this.harvester[file] = harvester;
- harvester.harvest (file);
+ if (!this.harvester.contains (file)) {
+ var harvester = new MediaExportHarvester (parent,
+ this.media_db,
+ this.extractor,
+ this.monitor);
+ harvester.harvested.connect (this.on_file_harvested);
+ this.harvester[file] = harvester;
+ harvester.harvest (file);
+ } else {
+ warning ("%s already scheduled for harvesting. Check config " +
+ "for duplicates.",
+ file.get_uri ());
+ }
}
private void on_file_changed (File file,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]