From 44f090fd92b1dad9fb7294d667a69fa9e9d54702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Sun, 23 Feb 2020 10:17:49 -0500 Subject: [PATCH] WIP --- bazarr/api.py | 10 +++++++ bazarr/main.py | 6 +++++ views/_main.html | 2 +- views/systemlogs.html | 4 +-- views/systemproviders.html | 55 ++++++++++++++++++++++++++++++++++++++ views/systemtasks.html | 1 + 6 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 views/systemproviders.html diff --git a/bazarr/api.py b/bazarr/api.py index ae4fc88f1..91ca3f625 100644 --- a/bazarr/api.py +++ b/bazarr/api.py @@ -103,6 +103,15 @@ class SystemLogs(Resource): return jsonify(data=logs) +class SystemProviders(Resource): + def get(self): + throttled_providers = list_throttled_providers() + for i in range(len(throttled_providers)): + throttled_providers[i][1] = throttled_providers[i][1] if throttled_providers[i][1] is not None else "Good" + throttled_providers[i][2] = throttled_providers[i][2] if throttled_providers[i][2] != "now" else "-" + return jsonify(data=throttled_providers) + + class SystemStatus(Resource): def get(self): system_status = {} @@ -1123,6 +1132,7 @@ api.add_resource(Languages, '/languages') api.add_resource(SystemTasks, '/systemtasks') api.add_resource(SystemLogs, '/systemlogs') +api.add_resource(SystemProviders, '/systemproviders') api.add_resource(SystemStatus, '/systemstatus') api.add_resource(SystemReleases, '/systemreleases') diff --git a/bazarr/main.py b/bazarr/main.py index 6d4474a62..753290d1d 100644 --- a/bazarr/main.py +++ b/bazarr/main.py @@ -1028,6 +1028,12 @@ def systemlogs(): return render_template('systemlogs.html') +@app.route('/systemproviders') +@login_required +def systemproviders(): + return render_template('systemproviders.html') + + @app.route('/systemstatus') @login_required def systemstatus(): diff --git a/views/_main.html b/views/_main.html index 1d141c419..96706f142 100644 --- a/views/_main.html +++ b/views/_main.html @@ -190,7 +190,7 @@
diff --git a/views/systemlogs.html b/views/systemlogs.html index 738dbbccb..7b59ceeec 100644 --- a/views/systemlogs.html +++ b/views/systemlogs.html @@ -56,8 +56,8 @@Name | +Status | +Next Retry | +
---|