]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
api: add api/pathlist for python-json.py
authorJaroslav Kysela <perex@perex.cz>
Wed, 30 Aug 2017 14:54:23 +0000 (16:54 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 30 Aug 2017 14:54:23 +0000 (16:54 +0200)
src/api.c

index 66d5d8b988a8f1824f3f73a9f5c1dc59f2c611e4..347f24b2e51f96e51ec4ac66fde8727d3ff646bb 100644 (file)
--- 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);