diff --git a/src/main/lkt.c b/src/main/lkt.c index f5ab077b08979487218fe39e37dd100f5c56e426..2ebe7a81e86893baf74ba349fda20c19962e2eb4 100644 --- a/src/main/lkt.c +++ b/src/main/lkt.c @@ -177,15 +177,38 @@ 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; } - 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 */