Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
api: move /capabilities url to /api/config/capabilities
  • Loading branch information
perexg committed Sep 15, 2015
1 parent 99edd68 commit bed3889
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/api.h
Expand Up @@ -25,7 +25,7 @@
#include "redblack.h"
#include "access.h"

#define TVH_API_VERSION 16
#define TVH_API_VERSION 17

/*
* Command hook
Expand Down
13 changes: 11 additions & 2 deletions src/api/api_config.c
Expand Up @@ -23,12 +23,21 @@
#include "api.h"
#include "config.h"

static int
api_config_capabilities(access_t *perm, void *opaque, const char *op,
htsmsg_t *args, htsmsg_t **resp)
{
*resp = tvheadend_capabilities_list(0);
return 0;
}

void
api_config_init ( void )
{
static api_hook_t ah[] = {
{ "config/load", ACCESS_ADMIN, api_idnode_load_simple, &config },
{ "config/save", ACCESS_ADMIN, api_idnode_save_simple, &config },
{ "config/capabilities", ACCESS_WEB_INTERFACE, api_config_capabilities, NULL },
{ "config/load", ACCESS_ADMIN, api_idnode_load_simple, &config },
{ "config/save", ACCESS_ADMIN, api_idnode_save_simple, &config },
{ NULL },
};

Expand Down
15 changes: 0 additions & 15 deletions src/webui/extjs.c
Expand Up @@ -475,20 +475,6 @@ extjs_tvhlog(http_connection_t *hc, const char *remain, void *opaque)
return 0;
}

/**
* Capability check
*/
static int
extjs_capabilities(http_connection_t *hc, const char *remain, void *opaque)
{
htsbuf_queue_t *hq = &hc->hc_reply;
htsmsg_t *l = tvheadend_capabilities_list(0);
htsmsg_json_serialize(l, hq, 0);
htsmsg_destroy(l);
http_output_content(hc, "text/x-json; charset=UTF-8");
return 0;
}

/**
* WEB user interface
*/
Expand All @@ -498,7 +484,6 @@ extjs_start(void)
http_path_add("/about.html", NULL, page_about, ACCESS_WEB_INTERFACE);
http_path_add("/extjs.html", NULL, extjs_root, ACCESS_WEB_INTERFACE);
http_path_add("/tv.html", NULL, extjs_livetv, ACCESS_WEB_INTERFACE);
http_path_add("/capabilities", NULL, extjs_capabilities, ACCESS_WEB_INTERFACE);
http_path_add("/epggrab", NULL, extjs_epggrab, ACCESS_WEB_INTERFACE);
http_path_add("/tvhlog", NULL, extjs_tvhlog, ACCESS_ADMIN);
}
2 changes: 1 addition & 1 deletion src/webui/static/app/tvheadend.js
Expand Up @@ -166,7 +166,7 @@ tvheadend.doQueryAnyMatch = function(q, forceAll) {
* General capabilities
*/
Ext.Ajax.request({
url: 'capabilities',
url: 'api/config/capabilities',
success: function(d)
{
if (d && d.responseText)
Expand Down

0 comments on commit bed3889

Please sign in to comment.