diff --git a/Common.py b/Common.py index e147047..c5e74a8 100644 --- a/Common.py +++ b/Common.py @@ -47,9 +47,10 @@ def getCurrentStatus(): os.system("rm -f `find . -ctime 1 -name '*.flv'`") _mem = psutil.virtual_memory() _net = psutil.net_io_counters() - if 60 > getTimeDelta(datetime.now(),network["currentTime"]) > 0: - _outSpeed = (_net.bytes_sent - network["out"]["currentByte"])/getTimeDelta(datetime.now(),network["currentTime"]) - _inSpeed = (_net.bytes_recv - network["in"]["currentByte"])/getTimeDelta(datetime.now(),network["currentTime"]) + _delta= getTimeDelta(datetime.now(),network["currentTime"]) + if 60 > _delta > 0: + _inSpeed = (_net.bytes_recv - network["in"]["currentByte"])/_delta + _outSpeed = (_net.bytes_sent - network["out"]["currentByte"])/_delta else: _outSpeed = 0 _inSpeed = 0 diff --git a/WebMain.py b/WebMain.py index a7e963b..482a49c 100644 --- a/WebMain.py +++ b/WebMain.py @@ -32,6 +32,7 @@ def readConfig(): @app.route("/config", methods=["POST"]) def writeConfig(): # TODO : 完善 + Common.appendOperation("更新配置") Common.reloadConfig() return jsonify({"message":"ok","code":200,"status":0,"data":request.form}) diff --git a/bilibili.py b/bilibili.py index 69761ee..000158e 100644 --- a/bilibili.py +++ b/bilibili.py @@ -336,7 +336,7 @@ class Bilibili: "order_id": 0, "videos": self.videos} ) - Common.appendUploadStatus("[{}] Published | Result : {}".format(title, r.text)) + Common.modifyLastUploadStatus("[{}] Published | Result : {}".format(title, r.text)) def reloadFromPrevious(self): if os.path.exists("uploaded.json"): diff --git a/liveDownloader.py b/liveDownloader.py index 0558840..b6679e8 100644 --- a/liveDownloader.py +++ b/liveDownloader.py @@ -37,6 +37,7 @@ def download(url): f.close() isDownload = False if os.path.getsize(path) < 1024 * 1024: + Common.modifyLastDownloadStatus("Downloaded File >{}< is too small, will ignore it".format(path)) os.remove(path) return False if Common.forceNotDownload: diff --git a/templates/files.html b/templates/files.html index 9e2e62a..c999a08 100644 --- a/templates/files.html +++ b/templates/files.html @@ -18,6 +18,7 @@ {% endfor %}
+

录播信息页

{% include 'device.html' %} diff --git a/templates/index.html b/templates/index.html index 13f0ecd..ad048f3 100644 --- a/templates/index.html +++ b/templates/index.html @@ -50,28 +50,29 @@ - + + - + - - + - +
下载日志
转码日志转码队列
转码队列
上传日志上传队列
上传队列
错误日志
操作日志

+

所有录播文件

{% include 'device.html' %}