media-export: Make harvesting of metadata optional
authorJens Georg <mail@jensge.org>
Fri, 14 May 2010 21:14:28 +0000 (23:14 +0200)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Mon, 7 Jun 2010 13:33:02 +0000 (16:33 +0300)
This commit introduces a new boolean configuration setting called
"extract-metadata" which disables harvesting completely. If not
configured, it defaults to "false"

This will also renders virtual folders useless since those are based on
metadata.

src/plugins/media-export/rygel-media-export-metadata-extractor.vala

index 03b3033..7c83a1c 100644 (file)
@@ -107,8 +107,18 @@ public class Rygel.MediaExport.MetadataExtractor: GLib.Object {
     }
 
     public static MetadataExtractor? create() {
-        if (factory == null) {
-            debug ("Checking for gstreamer element 'playbin'...");
+        var config = MetaConfig.get_default ();
+        bool extract_metadata;
+
+        try {
+            extract_metadata = config.get_bool ("MediaExport",
+                                                "extract-metadata");
+        } catch (Error error) {
+            extract_metadata = false;
+        }
+
+        if (factory == null && extract_metadata) {
+            debug ("Checking for gstreamer element 'playbin'..."));
             var factory = ElementFactory.find("playbin2");
             if (factory != null) {
                 debug (_("Using playbin2"));