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

LKT: Add a way to explicit types for queries where the type can be inferred

parent a1d043ee
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!127Lkt update
......@@ -177,17 +177,40 @@ if (STR_MATCH(lg, args->argv[0])) { \
if (STR_MATCH("author", args->argv[0])) {
*type = LKT_QUERY_TYPE_AUTHOR;
__concat_strings(regex, regex_len, args->argv + 1, args->argc - 1);
return 0;
}
/* Type ?== playlist */
else if (STR_MATCH("plt", args->argv[0]) || STR_MATCH("playlist", args->argv[0])) {
*type = LKT_QUERY_TYPE_PLAYLIST;
__concat_strings(regex, regex_len, args->argv + 1, args->argc - 1);
return 0;
}
/* Explicit type for lang, category and type */
/* Type ?== category */
else if (STR_MATCH("cat", args->argv[0]) || STR_MATCH("category", args->argv[0])) {
*type = LKT_QUERY_TYPE_CAT;
safe_snprintf(regex, regex_len, "%s", args->argv[0]);
return 0;
}
/* Type ?== lang */
else if (STR_MATCH("lang", args->argv[0]) || STR_MATCH("language", args->argv[0])) {
*type = LKT_QUERY_TYPE_LANG;
safe_snprintf(regex, regex_len, "%s", args->argv[0]);
return 0;
}
/* Type ?== type */
if (STR_MATCH("type", args->argv[0])) {
*type = LKT_QUERY_TYPE_TYPE;
safe_snprintf(regex, regex_len, "%s", args->argv[0]);
return 0;
}
}
/* If 'query' is specified, skip it */
int index = STR_MATCH("query", args->argv[0]) ? 1 : 0;
strncat(regex, "%", regex_len - 1);
......
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