From: Jaroslav Kysela Date: Wed, 30 Aug 2017 14:54:23 +0000 (+0200) Subject: api: add api/pathlist for python-json.py X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ce99a092104c84de38ecb84a69f0f41b5dcdc999;p=thirdparty%2Ftvheadend.git api: add api/pathlist for python-json.py --- diff --git a/src/api.c b/src/api.c index 66d5d8b98..347f24b2e 100644 --- a/src/api.c +++ b/src/api.c @@ -111,10 +111,23 @@ api_serverinfo return 0; } +static int +api_pathlist + ( access_t *perm, void *opaque, const char *op, htsmsg_t *args, htsmsg_t **resp ) +{ + api_link_t *t; + *resp = htsmsg_create_list(); + RB_FOREACH(t, &api_hook_tree, link) { + htsmsg_add_str(*resp, NULL, t->hook->ah_subsystem); + } + return 0; +} + void api_init ( void ) { static api_hook_t h[] = { { "serverinfo", ACCESS_ANONYMOUS, api_serverinfo, NULL }, + { "pathlist", ACCESS_ANONYMOUS, api_pathlist, NULL }, { NULL, 0, NULL, NULL } }; api_register_all(h);