From d91ac3ff422e4e9c0f72356586a10d2a20f8eb21 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Fri, 7 Jul 2006 22:24:48 +0000 Subject: [PATCH] Exclude radio station metadata from browse info. Not sure this is entirely correct. Should it be a config option? --- src/db-sql.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/db-sql.c b/src/db-sql.c index 43cfa60f..a9dc586b 100644 --- a/src/db-sql.c +++ b/src/db-sql.c @@ -1179,6 +1179,18 @@ int db_sql_enum_start(char **pe, DBQUERYINFO *pinfo) { return -1; } + /* don't browse radio station metadata */ + if(browse) { + if(have_clause) { + strcat(query_rest," and "); + } else { + strcpy(query_rest," where "); + have_clause = 1; + } + + strcat(query_rest,"(data_kind = 0) "); + } + /* Apply the query/filter */ if(pinfo->pt) { DPRINTF(E_DBG,L_DB,"Got query/filter\n"); @@ -1188,6 +1200,7 @@ int db_sql_enum_start(char **pe, DBQUERYINFO *pinfo) { strcat(query_rest," and "); } else { strcpy(query_rest," where "); + have_clause=1; } strcat(query_rest,"("); strcat(query_rest,filter); @@ -1206,6 +1219,7 @@ int db_sql_enum_start(char **pe, DBQUERYINFO *pinfo) { strcat(query_rest," and ("); } else { strcpy(query_rest," where ("); + have_clause = 1; } switch(pinfo->query_type) {