[rygel/gnome-2-32] media-export: Use simple mode fallback



commit 92d71f76229ed48f51a8ccccd23f699c7aee915b
Author: Jens Georg <mail jensge org>
Date:   Tue Oct 19 13:27:54 2010 +0200

    media-export: Use simple mode fallback
    
    If files are not discoverable, use simple mode for that file

 .../rygel-media-export-harvesting-task.vala        |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-harvesting-task.vala b/src/plugins/media-export/rygel-media-export-harvesting-task.vala
index a4c8675..d6aa881 100644
--- a/src/plugins/media-export/rygel-media-export-harvesting-task.vala
+++ b/src/plugins/media-export/rygel-media-export-harvesting-task.vala
@@ -327,6 +327,23 @@ public class Rygel.MediaExport.HarvestingTask : Rygel.StateMachine, GLib.Object
             return;
         }
 
+        try {
+            var info = file.query_info (HARVESTER_ATTRIBUTES,
+                                        FileQueryInfoFlags.NONE,
+                                        this.cancellable);
+            string content_type = info.get_content_type ();
+            string mime = g_content_type_get_mime_type (content_type);
+            uint64 size = info.get_size ();
+            uint64 mtime = info.get_attribute_uint64 (
+                                        FILE_ATTRIBUTE_TIME_MODIFIED);
+            this.on_extracted_cb (file, null, mime, size, mtime);
+        } catch (Error error) {
+            debug ("Could not get basic file information for %s: %s." +
+                   "Ignoring",
+                   file.get_uri (),
+                   error.message);
+        }
+
         this.files.poll ();
         this.do_update ();
     }



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