Continuing development

pull/292/head
morpheus65535 6 years ago
parent 005b78f350
commit 82793da436

@ -1,4 +1,6 @@
from get_argv import config_dir
from queue import q4ws
import datetime
import os
import sqlite3
@ -9,6 +11,7 @@ from get_settings import get_general_settings
from list_subtitles import list_missing_subtitles
def update_series():
q4ws.put("Update series list from Sonarr is running...")
from get_settings import get_sonarr_settings
url_sonarr = get_sonarr_settings()[6]
apikey_sonarr = get_sonarr_settings()[4]
@ -51,6 +54,7 @@ def update_series():
series_to_add = []
for show in r.json():
q4ws.put("Getting data for this show: " + show['title'])
try:
overview = unicode(show['overview'])
except:
@ -105,6 +109,8 @@ def update_series():
db.commit()
db.close()
q4ws.put("Update series list from Sonarr is ended.")
def get_profile_list():
from get_settings import get_sonarr_settings
url_sonarr = get_sonarr_settings()[6]

@ -1,5 +1,7 @@
bazarr_version = '0.6.9'
from gevent import monkey; monkey.patch_all()
import gc
gc.enable()
@ -20,6 +22,7 @@ from update_db import *
from notifier import update_notifier
update_notifier()
import queue
from get_settings import get_general_settings, get_proxy_settings
import logging
@ -1739,12 +1742,8 @@ def handle_websocket():
abort(400, 'Expected WebSocket request.')
while True:
try:
message = wsock.receive()
wsock.send("Your message was: %r" % message)
except WebSocketError:
break
while not q4ws.empty():
wsock.send(q4ws.get_nowait())
import warnings
# Mute DeprecationWarning

@ -1,6 +1,8 @@
<html>
<head>
<!DOCTYPE html>
<link href="{{base_url}}static/noty/noty.css" rel="stylesheet">
<script src="{{base_url}}static/noty/noty.min.js" type="text/javascript"></script>
<style>
#divmenu {
background-color: #000000;
@ -211,6 +213,13 @@
<script type="text/javascript">
var ws = new WebSocket("ws://" + window.location.host + "{{base_url}}websocket");
ws.onmessage = function (evt) {
console.log(evt.data);
new Noty({
text: evt.data,
timeout: 3000,
killer: true,
type: 'success',
layout: 'bottomRight',
theme: 'semanticui'
}).show();
};
</script>
Loading…
Cancel
Save