[rygel] media-export: Use fuse path instead of URI if possible



commit 51d449c34852e5a4e3ee2c0297d61293f0df617a
Author: Jens Georg <mail jensge org>
Date:   Sat Apr 30 18:15:51 2016 +0200

    media-export: Use fuse path instead of URI if possible
    
    Signed-off-by: Jens Georg <mail jensge org>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=685800

 .../media-export/rygel-media-export-extract.vala   |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-extract.vala 
b/src/plugins/media-export/rygel-media-export-extract.vala
index 44ec929..efac27f 100644
--- a/src/plugins/media-export/rygel-media-export-extract.vala
+++ b/src/plugins/media-export/rygel-media-export-extract.vala
@@ -87,7 +87,17 @@ async void run () {
                             var parser = new Rygel.DVDParser (file);
                             yield parser.run ();
                         } else if (!is_text) {
-                            info = discoverer.discover_uri (parts[0]);
+                            var file = File.new_for_uri (parts[0]);
+                            var path = file.get_path ();
+                            var uri = parts[0];
+
+                            if (path != null) {
+                                warning ("Using local path %s instead of %s",
+                                         path, uri);
+                                uri = Filename.to_uri (path);
+                            }
+
+                            info = discoverer.discover_uri (uri);
 
                             debug ("Finished discover on URI %s", parts[0]);
                         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]