diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2024-02-19 01:44:02 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2024-02-19 01:44:11 +0300 |
commit | 3741f7cf78a288e967415ccb6736c888a21c211b (patch) | |
tree | a48d8331c9936d6c108de4d0f9179a089b1e56e6 /include/py/homekit/media | |
parent | d79309e498cdc1358c81367ce2a93a5731e517d1 (diff) |
web_kbn: almost completely ported lws to python
Diffstat (limited to 'include/py/homekit/media')
-rw-r--r-- | include/py/homekit/media/node_server.py | 10 |
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'] |