Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 0ecc7911 rédigé par Kubat's avatar Kubat
Parcourir les fichiers

Also set column name from the table 'kara' when possible

parent 11a0abb0
Branches
Étiquettes
1 requête de fusion!98Queue and playlist interactions with lkt
...@@ -16,6 +16,7 @@ enum lkt_uri_type { ...@@ -16,6 +16,7 @@ enum lkt_uri_type {
struct lkt_uri { struct lkt_uri {
enum lkt_uri_type type; enum lkt_uri_type type;
const char *column_name;
union { union {
void *value; void *value;
size_t id; size_t id;
......
...@@ -23,24 +23,31 @@ __prefix(char *str, struct lkt_uri *ret) ...@@ -23,24 +23,31 @@ __prefix(char *str, struct lkt_uri *ret)
return NULL; return NULL;
if (STR_NMATCH(str, "id", 2)) { if (STR_NMATCH(str, "id", 2)) {
ret->column_name = LKT_DATABASE_NAME_KID;
ret->type = uri_id; ret->type = uri_id;
val = str + 2; val = str + 2;
} else if (STR_NMATCH(str, "playlist", 8)) { } else if (STR_NMATCH(str, "playlist", 8)) {
ret->column_name = NULL;
ret->type = uri_playlist; ret->type = uri_playlist;
val = str + 3; val = str + 3;
} else if (STR_NMATCH(str, "type", 4)) { } else if (STR_NMATCH(str, "type", 4)) {
ret->column_name = LKT_DATABASE_NAME_KTYPE;
ret->type = uri_type; ret->type = uri_type;
val = str + 4; val = str + 4;
} else if (STR_NMATCH(str, "author", 6)) { } else if (STR_NMATCH(str, "author", 6)) {
ret->column_name = LKT_DATABASE_NAME_KAUTHOR;
ret->type = uri_author; ret->type = uri_author;
val = str + 6; val = str + 6;
} else if (STR_NMATCH(str, "category", 8)) { } else if (STR_NMATCH(str, "category", 8)) {
ret->column_name = LKT_DATABASE_NAME_KCAT;
ret->type = uri_category; ret->type = uri_category;
val = str + 8; val = str + 8;
} else if (STR_NMATCH(str, "lang", 4)) { } else if (STR_NMATCH(str, "lang", 4)) {
ret->column_name = LKT_DATABASE_NAME_KLANG;
ret->type = uri_language; ret->type = uri_language;
val = str + 4; val = str + 4;
} else if (STR_NMATCH(str, "query", 5)) { } else if (STR_NMATCH(str, "query", 5)) {
ret->column_name = LKT_DATABASE_KARA_ALL;
ret->type = uri_query; ret->type = uri_query;
val = str + 5; val = str + 5;
} else } else
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter