[totem] main: Only allow adding videos to the recent view



commit e17e79f4e35efcc321b1eb8363ab3b6b17ae65dc
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Feb 17 13:56:54 2014 +0100

    main: Only allow adding videos to the recent view
    
    Not directories at all. This also makes sure that the type
    of media added is video, and not a generic type.

 src/totem-grilo.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/totem-grilo.c b/src/totem-grilo.c
index 25522e8..e7b7538 100644
--- a/src/totem-grilo.c
+++ b/src/totem-grilo.c
@@ -2453,23 +2453,23 @@ totem_grilo_add_item_to_recent (TotemGrilo *self,
                GrlOperationOptions *options;
 
                options = grl_operation_options_new (NULL);
-               media = grl_pls_file_to_media (NULL,
+               media = grl_media_video_new ();
+               media = grl_pls_file_to_media (media,
                                               file,
                                               NULL,
                                               FALSE,
                                               options);
-               if (title)
+               if (media && title)
                        grl_media_set_title (media, title);
 
-               /* We don't handle directories yet */
-               if (media == GRL_IS_MEDIA_BOX (media))
-                       g_clear_object (&media);
-
                g_object_unref (options);
        }
 
        g_object_unref (file);
 
+       if (!media)
+               return FALSE;
+
        /* This should be quick, just adding the item to the DB */
        grl_source_store_sync (self->priv->bookmarks_src,
                               NULL,


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