[totem] main: Load bookmark-time if mtime isn't available



commit 701dfeea1b13c89099b8e2b20790d9a334e4c282
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Oct 14 19:37:41 2014 +0200

    main: Load bookmark-time if mtime isn't available
    
    So we don't fail to load thumbnails for bookmarks because of the lack of
    modification time property.

 src/icon-helpers.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/icon-helpers.c b/src/icon-helpers.c
index a24418f..b6a0f19 100644
--- a/src/icon-helpers.c
+++ b/src/icon-helpers.c
@@ -140,7 +140,16 @@ thumbnail_media_async_thread (GTask    *task,
 
        media = GRL_MEDIA (g_task_get_source_object (task));
        uri = grl_media_get_url (media);
+
        mtime = grl_media_get_modification_date (media);
+       if (!mtime) {
+               GrlRegistry *registry;
+               GrlKeyID key_id;
+
+               registry = grl_registry_get_default ();
+               key_id = grl_registry_lookup_metadata_key (registry, "bookmark-date");
+               mtime = grl_data_get_boxed (GRL_DATA (media), key_id);
+       }
 
        if (!uri || !mtime) {
                g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED, "URI or mtime missing");


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