[rygel/rygel-0-16] server: Generate thumbs for native files only



commit 8e3d3afe9bb2882937dbd4d42e855d2489a07496
Author: Jens Georg <jensg openismus com>
Date:   Thu Nov 15 15:41:28 2012 +0100

    server: Generate thumbs for native files only

 src/librygel-server/rygel-thumbnailer.vala |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/librygel-server/rygel-thumbnailer.vala b/src/librygel-server/rygel-thumbnailer.vala
index 4dfb462..52d356c 100644
--- a/src/librygel-server/rygel-thumbnailer.vala
+++ b/src/librygel-server/rygel-thumbnailer.vala
@@ -68,6 +68,11 @@ internal class Rygel.Thumbnailer : GLib.Object {
 
     public Thumbnail get_thumbnail (string uri, string mime_type) throws Error {
         var file = File.new_for_uri (uri);
+        if (!file.is_native ()) {
+            throw new ThumbnailerError.NO_THUMBNAIL
+                                        (_("Thubmnailing not supported"));
+        }
+
         var info = file.query_info (FileAttribute.THUMBNAIL_PATH + "," +
                                     FileAttribute.THUMBNAILING_FAILED,
                                     FileQueryInfoFlags.NONE);



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