[totem/gnome-3-14] main: Only show videos longer than 5 seconds



commit 2053e3169da7486788526eea65d9216664c8d996
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Dec 2 13:33:39 2014 +0100

    main: Only show videos longer than 5 seconds
    
    https://bugzilla.gnome.org/show_bug.cgi?id=737469

 src/totem-grilo.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/totem-grilo.c b/src/totem-grilo.c
index 645a316..41ac070 100644
--- a/src/totem-grilo.c
+++ b/src/totem-grilo.c
@@ -52,6 +52,7 @@
 #define BROWSE_FLAGS          (GRL_RESOLVE_FAST_ONLY | GRL_RESOLVE_IDLE_RELAY)
 #define PAGE_SIZE             50
 #define SCROLL_GET_MORE_LIMIT 0.8
+#define MAX_DURATION          5
 
 /* casts are to shut gcc up */
 static const GtkTargetEntry target_table[] = {
@@ -739,6 +740,10 @@ browse (TotemGrilo   *self,
        }
        if (grl_caps_get_type_filter (caps) & GRL_TYPE_FILTER_VIDEO)
                grl_operation_options_set_type_filter (default_options, GRL_TYPE_FILTER_VIDEO);
+       if (grl_caps_is_key_range_filter (caps, GRL_METADATA_KEY_DURATION))
+               grl_operation_options_set_key_range_filter (default_options,
+                                                           GRL_METADATA_KEY_DURATION, MAX_DURATION, NULL,
+                                                           NULL);
 
        bud = g_slice_new0 (BrowseUserData);
        bud->totem_grilo = g_object_ref (self);
@@ -841,6 +846,9 @@ get_search_options (TotemGrilo *self)
        grl_operation_options_set_skip (default_options, self->priv->search_page * PAGE_SIZE);
        grl_operation_options_set_count (default_options, PAGE_SIZE);
        grl_operation_options_set_type_filter (default_options, GRL_TYPE_FILTER_VIDEO);
+       grl_operation_options_set_key_range_filter (default_options,
+                                                   GRL_METADATA_KEY_DURATION, MAX_DURATION, NULL,
+                                                   NULL);
 
        /* And now remove all the unsupported filters and options */
        grl_operation_options_obey_caps (default_options,


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