From 9f7aa34f0c4b818865bc677e8fdccc05163bd78f Mon Sep 17 00:00:00 2001 From: Kubat <mael.martin31@gmail.com> Date: Sat, 11 Apr 2020 14:44:59 +0200 Subject: [PATCH] Adding new commands in lkt --- src/main/lkt.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/main/lkt.c b/src/main/lkt.c index 5d8647b6..ee8bd03b 100644 --- a/src/main/lkt.c +++ b/src/main/lkt.c @@ -71,12 +71,14 @@ help(void) " add <query>: add to the queue and prints the results of the query.\n" " insert <query>: insert on top of the aueue and prints the results of the query.\n" " plt <plt> <query>: search inside a playlist and prints the results.\n" + " count <query>: count the number of songs that matches the query.\n" + " queue <query>: prints kara that matches from the queue.\n" "\n" " QUERY:\n" " A query is passed in argument of a COMMAND and is composed of:\n" " - The first word must be the type\n" " - the rest is used for the sqlite regex\n" - " Supported types are: title, [a]ny, source, [auth]or, [lang]uage, type.\n" + " Supported types are: title, [a]ny, source, [auth]or, [lang]uage, type, title\n" "\n" " RANGE:\n" " A range is specified like in python:\n" @@ -756,8 +758,19 @@ search_insert__(struct lkt_cmd_args *args) noreturn void search_plt__(struct lkt_cmd_args *args) { - (void) args; - fail("Not implemented"); + search_with_cmd__(args, "listplaylist"); +} + +noreturn void +search_count__(struct lkt_cmd_args *args) +{ + search_with_cmd__(args, "count"); +} + +noreturn void +search_queue__(struct lkt_cmd_args *args) +{ + search_with_cmd__(args, "playlistinfo"); } /* Parsing stuff. */ @@ -777,6 +790,8 @@ static struct lkt_cmd_opt options_search[] = { { .name = "add", .call = search_add__ }, { .name = "insert", .call = search_insert__ }, { .name = "plt", .call = search_plt__ }, + { .name = "count", .call = search_count__ }, + { .name = "queue", .call = search_queue__ }, LKT_OPT_NULL, }; -- GitLab