[PATCH 1/7] vimeo: Handle search all elements
- From: "Juan A. Suarez Romero" <jasuarez igalia com>
- To: grilo-list gnome org
- Subject: [PATCH 1/7] vimeo: Handle search all elements
- Date: Thu, 3 Feb 2011 10:40:40 +0100
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);
--
1.7.3.5
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]