musicdlp/backend/response.py
2024-05-02 17:18:27 +04:00

22 lines
390 B
Python

import json
OK = '{"ok":true}'
def ok_init(key: str) -> str:
return json.dumps({
"ok": True,
"data": key,
})
def ok_playlist(items: list[str]) -> str:
return json.dumps({
"ok": True,
"data": items,
})
def error_field(field: str) -> str:
return json.dumps({
"ok": False,
"error": "field",
"data": field,
})