From bf5026151f4381f41e9c54e9132e16d358e75e23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Mon, 13 Jul 2020 13:59:11 -0400 Subject: [PATCH] Fix for wanted pages. --- bazarr/api.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bazarr/api.py b/bazarr/api.py index ef765ceef..80d159e0c 100644 --- a/bazarr/api.py +++ b/bazarr/api.py @@ -1324,6 +1324,11 @@ class WantedSeries(Resource): length = request.args.get('length') or -1 draw = request.args.get('draw') + data_count = database.execute("SELECT table_episodes.monitored, table_shows.tags, table_shows.seriesType FROM " + "table_episodes INNER JOIN table_shows on table_shows.sonarrSeriesId = " + "table_episodes.sonarrSeriesId WHERE table_episodes.missing_subtitles != '[]'") + data_count = filter_exclusions(data_count, 'series') + row_count = len(data_count) data = database.execute("SELECT table_shows.title as seriesTitle, table_episodes.monitored, " "table_episodes.season || 'x' || table_episodes.episode as episode_number, " "table_episodes.title as episodeTitle, table_episodes.missing_subtitles, " @@ -1334,7 +1339,6 @@ class WantedSeries(Resource): "table_episodes.missing_subtitles != '[]' ORDER BY table_episodes._rowid_ DESC LIMIT ? " "OFFSET ?", (length, start)) data = filter_exclusions(data, 'series') - row_count = len(data) for item in data: # Parse missing subtitles @@ -1366,11 +1370,13 @@ class WantedMovies(Resource): length = request.args.get('length') or -1 draw = request.args.get('draw') + data_count = database.execute("SELECT tags, monitored FROM table_movies WHERE missing_subtitles != '[]'") + data_count = filter_exclusions(data_count, 'movie') + row_count = len(data_count) data = database.execute("SELECT title, missing_subtitles, radarrId, path, hearing_impaired, sceneName, " "failedAttempts, tags, monitored FROM table_movies WHERE missing_subtitles != '[]' " "ORDER BY _rowid_ DESC LIMIT ? OFFSET ?", (length, start)) data = filter_exclusions(data, 'movie') - row_count = len(data) for item in data: # Parse missing subtitles