mirror of https://github.com/morpheus65535/bazarr
Add some interfaces in backend to send message and progress
This commit is contained in:
parent
24cb712ad7
commit
8fcffaf339
|
@ -17,3 +17,15 @@ def event_stream(type, action="update", payload=None):
|
||||||
except (ValueError, TypeError):
|
except (ValueError, TypeError):
|
||||||
pass
|
pass
|
||||||
socketio.emit("data", {"type": type, "action": action, "payload": payload})
|
socketio.emit("data", {"type": type, "action": action, "payload": payload})
|
||||||
|
|
||||||
|
|
||||||
|
def show_message(msg):
|
||||||
|
event_stream(type="message", payload=msg)
|
||||||
|
|
||||||
|
|
||||||
|
def show_progress(name, percent):
|
||||||
|
event_stream(type="progress", payload={"name": name, "percent": percent})
|
||||||
|
|
||||||
|
|
||||||
|
def hide_progress(name):
|
||||||
|
event_stream(type="progress", action="delete", payload={"name": name, "percent": 0})
|
||||||
|
|
Loading…
Reference in New Issue