summaryrefslogtreecommitdiff
path: root/include/py/homekit/media
diff options
context:
space:
mode:
Diffstat (limited to 'include/py/homekit/media')
-rw-r--r--include/py/homekit/media/node_server.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/py/homekit/media/node_server.py b/include/py/homekit/media/node_server.py
index 5d0803c..229b9f7 100644
--- a/include/py/homekit/media/node_server.py
+++ b/include/py/homekit/media/node_server.py
@@ -33,12 +33,12 @@ class MediaNodeServer(http.HTTPServer):
raise ValueError(f'invalid duration: max duration is {max}')
record_id = self.recorder.record(duration)
- return http.ok({'id': record_id})
+ return http.ajax_ok({'id': record_id})
async def record_info(self, request: http.Request):
record_id = int(request.match_info['id'])
info = self.recorder.get_info(record_id)
- return http.ok(info.as_dict())
+ return http.ajax_ok(info.as_dict())
async def record_forget(self, request: http.Request):
record_id = int(request.match_info['id'])
@@ -47,7 +47,7 @@ class MediaNodeServer(http.HTTPServer):
assert info.status in (RecordStatus.FINISHED, RecordStatus.ERROR), f"can't forget: record status is {info.status}"
self.recorder.forget(record_id)
- return http.ok()
+ return http.ajax_ok()
async def record_download(self, request: http.Request):
record_id = int(request.match_info['id'])
@@ -64,7 +64,7 @@ class MediaNodeServer(http.HTTPServer):
if extended:
files = list(map(lambda file: file.__dict__(), files))
- return http.ok({
+ return http.ajax_ok({
'files': files
})
@@ -75,7 +75,7 @@ class MediaNodeServer(http.HTTPServer):
raise ValueError(f'file {file} not found')
self.storage.delete(file)
- return http.ok()
+ return http.ajax_ok()
async def storage_download(self, request):
file_id = request.query['file_id']