[grilo-plugins] podcasts: Implement search all elements
- From: Juan A. Suarez Romero <jasuarez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo-plugins] podcasts: Implement search all elements
- Date: Mon, 7 Feb 2011 20:42:14 +0000 (UTC)
commit 0c03b66b4e34d66bbe1ba424ac2d032f8d563091
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date: Wed Feb 2 14:24:45 2011 +0100
podcasts: Implement search all elements
Signed-off-by: Juan A. Suarez Romero <jasuarez igalia com>
src/podcasts/grl-podcasts.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/src/podcasts/grl-podcasts.c b/src/podcasts/grl-podcasts.c
index bf4e406..b66d369 100644
--- a/src/podcasts/grl-podcasts.c
+++ b/src/podcasts/grl-podcasts.c
@@ -120,6 +120,10 @@ GRL_LOG_DOMAIN_STATIC(podcasts_log_domain);
" OR p.title LIKE '%%%s%%' OR p.desc LIKE '%%%s%%' " \
"LIMIT %u OFFSET %u"
+#define GRL_SQL_GET_PODCAST_STREAMS_ALL \
+ "SELECT * FROM streams " \
+ "LIMIT %u OFFSET %u"
+
#define GRL_SQL_GET_PODCAST_STREAM \
"SELECT * FROM streams " \
"WHERE url='%s' " \
@@ -636,9 +640,16 @@ produce_podcast_contents_from_db (OperationSpec *os)
db = GRL_PODCASTS_SOURCE (os->source)->priv->db;
/* Check if searching or browsing */
if (os->is_query) {
- sql = g_strdup_printf (GRL_SQL_GET_PODCAST_STREAMS_BY_TEXT,
- os->text, os->text, os->text, os->text,
- os->count, os->skip);
+ if (os->text) {
+ /* Search text */
+ sql = g_strdup_printf (GRL_SQL_GET_PODCAST_STREAMS_BY_TEXT,
+ os->text, os->text, os->text, os->text,
+ os->count, os->skip);
+ } else {
+ /* Return all */
+ sql = g_strdup_printf (GRL_SQL_GET_PODCAST_STREAMS_ALL,
+ os->count, os->skip);
+ }
} else {
sql = g_strdup_printf (GRL_SQL_GET_PODCAST_STREAMS,
os->media_id, os->count, os->skip);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]