From 04b487611ca60bd3b9ad288c520301d7521551b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Sat, 25 Jan 2020 12:08:20 -0500 Subject: [PATCH] WIP --- bazarr/api.py | 7 +- views/_main.html | 6 ++ views/episodes.html | 2 +- views/series.html | 175 +++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 186 insertions(+), 4 deletions(-) diff --git a/bazarr/api.py b/bazarr/api.py index d7f9b6ead..9e3b519f2 100644 --- a/bazarr/api.py +++ b/bazarr/api.py @@ -62,7 +62,7 @@ class Series(Resource): length = request.args.get('length') or -1 draw = request.args.get('draw') - seriesId = request.args.get('id') + seriesId = request.args.get('seriesid') row_count = database.execute("SELECT COUNT(*) as count FROM table_shows", only_one=True)['count'] if seriesId: result = database.execute("SELECT * FROM table_shows WHERE sonarrSeriesId=? ORDER BY sortTitle ASC LIMIT ? " @@ -70,6 +70,9 @@ class Series(Resource): else: result = database.execute("SELECT * FROM table_shows ORDER BY sortTitle ASC LIMIT ? OFFSET ?", (length, start)) for item in result: + # Add Datatables rowId + item.update({"DT_RowId": 'row_' + str(item['sonarrSeriesId'])}) + # Parse audio language if item['audio_language']: item.update({"audio_language": {"name": item['audio_language'], @@ -127,7 +130,7 @@ class Series(Resource): if str(lang) == "['']": lang = '[]' - hi = request.form.get('hearing_impaired') + hi = request.form.get('hi') forced = request.form.get('forced') if hi == "on": diff --git a/views/_main.html b/views/_main.html index f78d1e02a..5532b6b4f 100644 --- a/views/_main.html +++ b/views/_main.html @@ -34,6 +34,12 @@ + + {% endblock head_css %} {% block head %} diff --git a/views/episodes.html b/views/episodes.html index e6ca34455..2250473d3 100644 --- a/views/episodes.html +++ b/views/episodes.html @@ -321,7 +321,7 @@ "ordering": false, "lengthChange": false, "responsive": true, - "pageLength": 100, + "pageLength": {{ settings.general.page_size }}, "ajax": "{{ url_for('api.episodes') }}?seriesid={{id}}", rowGroup: { dataSrc: function(data) { diff --git a/views/series.html b/views/series.html index 452f4a788..bbce3ed86 100644 --- a/views/series.html +++ b/views/series.html @@ -28,15 +28,119 @@ Hearing-Impaired Forced Subtitles + + + {% endblock body %} {% block tail %} {% endblock tail %}