[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: Wed, 2 Feb 2011 21:26:35 +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 | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/src/vimeo/grl-vimeo.c b/src/vimeo/grl-vimeo.c
index af8f665..8273e99 100644
--- a/src/vimeo/grl-vimeo.c
+++ b/src/vimeo/grl-vimeo.c
@@ -385,9 +385,20 @@ 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_FAILED,
+ "Unable to search all elements");
+ 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]