[grilo-plugins] Add the thumbnail path



commit d911cb23ccbfba8db6bcfc1d7b4fc6de8f88c92c
Author: Chris Lord <chris linux intel com>
Date:   Wed May 26 15:12:59 2010 +0100

    Add the thumbnail path
    
    Add the thumbnail path to the GrlMedia items.

 src/filesystem/grl-filesystem.c |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/src/filesystem/grl-filesystem.c b/src/filesystem/grl-filesystem.c
index ab13ee4..0131955 100644
--- a/src/filesystem/grl-filesystem.c
+++ b/src/filesystem/grl-filesystem.c
@@ -43,7 +43,9 @@
   G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE ","    \
   G_FILE_ATTRIBUTE_STANDARD_TYPE ","            \
   G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN ","       \
-  G_FILE_ATTRIBUTE_TIME_MODIFIED
+  G_FILE_ATTRIBUTE_TIME_MODIFIED ","            \
+  G_FILE_ATTRIBUTE_THUMBNAIL_PATH ","           \
+  G_FILE_ATTRIBUTE_THUMBNAILING_FAILED
 
 #define FILE_ATTRIBUTES_FAST                    \
   G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN
@@ -351,6 +353,21 @@ create_content (GrlMedia *content,
     grl_media_set_date (GRL_DATA (media), time_str);
     g_free (time_str);
 
+    /* Thumbnail */
+    gboolean thumb_failed =
+      g_file_info_get_attribute_boolean (info,
+                                         G_FILE_ATTRIBUTE_THUMBNAILING_FAILED);
+    if (!thumb_failed) {
+      const gchar *thumb =
+        g_file_info_get_attribute_byte_string (info,
+                                               G_FILE_ATTRIBUTE_THUMBNAIL_PATH);
+      gchar *thumb_uri = g_filename_to_uri (thumb, NULL, NULL);
+      if (thumb_uri) {
+        grl_media_set_thumbnail (GRL_DATA (media), thumb_uri);
+        g_free (thumb_uri);
+      }
+    }
+
     g_object_unref (info);
   }
 



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