diff options
author | Bastien Nocera <hadess@hadess.net> | 2014-12-02 13:33:39 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2014-12-07 18:07:44 +0100 |
commit | f93cf2e5903955079791b97eb7df92b11ce9c182 (patch) | |
tree | ebafc2ea2718960b0e06f63b44609f2c79524977 | |
parent | f7fa3c96fe6f802d163239c3cbd9aabd01e8e4ce (diff) | |
download | totem-f93cf2e5903955079791b97eb7df92b11ce9c182.tar.gz |
main: Only show videos longer than 5 seconds
https://bugzilla.gnome.org/show_bug.cgi?id=737469
-rw-r--r-- | 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 645a3167e..41ac0703d 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, |