From f76003ca9ef549bdd61eaed32b17d9216d7966fe Mon Sep 17 00:00:00 2001 From: whatdoineed2do/Ray Date: Sat, 23 Jan 2021 15:19:27 +0000 Subject: [PATCH] [jsonapi] add param to 'api/update?path=....' endpoint to allow client request for path specific scans --- src/httpd_jsonapi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/httpd_jsonapi.c b/src/httpd_jsonapi.c index 09984541..0d0df6ec 100644 --- a/src/httpd_jsonapi.c +++ b/src/httpd_jsonapi.c @@ -1230,10 +1230,16 @@ static int jsonapi_reply_update(struct httpd_request *hreq) { const char *param; + const char *param_path; param = httpd_query_value_find(hreq->query, "scan_kind"); + param_path = httpd_query_value_find(hreq->query, "path"); + + if (param_path) + library_rescan_path(param_path); + else + library_rescan(db_scan_kind_enum(param)); - library_rescan(db_scan_kind_enum(param)); return HTTP_NOCONTENT; }