[grilo-plugins] vimeo: Handle search all elements
- From: Juan A. Suarez Romero <jasuarez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo-plugins] vimeo: Handle search all elements
- Date: Mon, 7 Feb 2011 20:41:49 +0000 (UTC)
commit cb6f48eeb1cba9008c4610bb1421cf28412f0f00
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date: Wed Feb 2 14:54:33 2011 +0100
vimeo: Handle search all elements
Vimeo does not support searching all elements.
Thus, an error is sent in this case.
Signed-off-by: Juan A. Suarez Romero <jasuarez igalia com>
src/vimeo/grl-vimeo.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/vimeo/grl-vimeo.c b/src/vimeo/grl-vimeo.c
index af8f665..a235217 100644
--- a/src/vimeo/grl-vimeo.c
+++ b/src/vimeo/grl-vimeo.c
@@ -385,9 +385,21 @@ grl_vimeo_source_search (GrlMediaSource *source,
GrlMediaSourceSearchSpec *ss)
{
SearchData *sd;
+ GError *error;
gint per_page;
GVimeo *vimeo = GRL_VIMEO_SOURCE (source)->priv->vimeo;
+ if (!ss->text) {
+ /* Vimeo does not support searching all */
+ error =
+ g_error_new_literal (GRL_CORE_ERROR,
+ GRL_CORE_ERROR_SEARCH_NULL_UNSUPPORTED,
+ "Unable to execute search: non NULL search text is required");
+ ss->callback (ss->source, ss->search_id, NULL, 0, ss->user_data, error);
+ g_error_free (error);
+ return;
+ }
+
/* Compute items per page and page offset */
per_page = CLAMP (1 + ss->skip + ss->count, 0, 100);
g_vimeo_set_per_page (vimeo, per_page);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]