mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-28 05:04:16 -05:00
[httpd/json] Add json api to httpd
This commit is contained in:
18
src/httpd.c
18
src/httpd.c
@@ -59,6 +59,7 @@
|
||||
#include "httpd_rsp.h"
|
||||
#include "httpd_daap.h"
|
||||
#include "httpd_dacp.h"
|
||||
#include "httpd_jsonapi.h"
|
||||
#include "httpd_streaming.h"
|
||||
#include "transcode.h"
|
||||
#ifdef LASTFM
|
||||
@@ -1221,6 +1222,12 @@ httpd_gen_cb(struct evhttp_request *req, void *arg)
|
||||
{
|
||||
dacp_request(req);
|
||||
|
||||
goto out;
|
||||
}
|
||||
else if (jsonapi_is_request(req, uri))
|
||||
{
|
||||
jsonapi_request(req);
|
||||
|
||||
goto out;
|
||||
}
|
||||
else if (streaming_is_request(req, uri))
|
||||
@@ -1495,6 +1502,14 @@ httpd_init(void)
|
||||
goto dacp_fail;
|
||||
}
|
||||
|
||||
ret = jsonapi_init();
|
||||
if (ret < 0)
|
||||
{
|
||||
DPRINTF(E_FATAL, L_HTTPD, "JSON api init failed\n");
|
||||
|
||||
goto jsonapi_fail;
|
||||
}
|
||||
|
||||
streaming_init();
|
||||
|
||||
#ifdef HAVE_EVENTFD
|
||||
@@ -1601,6 +1616,8 @@ httpd_init(void)
|
||||
#endif
|
||||
pipe_fail:
|
||||
streaming_deinit();
|
||||
jsonapi_deinit();
|
||||
jsonapi_fail:
|
||||
dacp_deinit();
|
||||
dacp_fail:
|
||||
daap_deinit();
|
||||
@@ -1647,6 +1664,7 @@ httpd_deinit(void)
|
||||
}
|
||||
|
||||
streaming_deinit();
|
||||
jsonapi_deinit();
|
||||
rsp_deinit();
|
||||
dacp_deinit();
|
||||
daap_deinit();
|
||||
|
||||
Reference in New Issue
Block a user