From bf6448d0be4e054d8ea551ed7b3385e6f2d9077a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Mon, 28 Oct 2019 12:53:21 -0400 Subject: [PATCH] WIP --- bazarr/main.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bazarr/main.py b/bazarr/main.py index e03d522fd..1aed88a77 100644 --- a/bazarr/main.py +++ b/bazarr/main.py @@ -518,7 +518,7 @@ def redirect_root(): def series(): authorize() - series_count = len(database.execute("SELECT COUNT(*) FROM table_shows")) + series_count = database.execute("SELECT COUNT(*) as count FROM table_shows", only_one=True)['count'] page = request.GET.page if page == "": page = "1" @@ -725,7 +725,7 @@ def episodes(no): def movies(): authorize() - missing_count = len(database.execute("SELECT COUNT(*) FROM table_movies")) + missing_count = database.execute("SELECT COUNT(*) as count FROM table_movies", only_one=True)['count'] page = request.GET.page if page == "": page = "1" @@ -911,9 +911,9 @@ def history(): def historyseries(): authorize() - row_count = len(database.execute("SELECT COUNT(*) FROM table_history LEFT JOIN table_shows on " - "table_history.sonarrSeriesId = table_shows.sonarrSeriesId WHERE " - "table_shows.title is not NULL")) + row_count = database.execute("SELECT COUNT(*) as count FROM table_history LEFT JOIN table_shows on " + "table_history.sonarrSeriesId = table_shows.sonarrSeriesId WHERE " + "table_shows.title is not NULL", only_one=True)['count'] page = request.GET.page if page == "": page = "1" @@ -990,9 +990,9 @@ def historyseries(): def historymovies(): authorize() - row_count = len(database.execute("SELECT COUNT(*) FROM table_history_movie LEFT JOIN table_movies ON " - "table_history_movie.radarrId=table_movies.radarrId " - "WHERE table_movies.title is not NULL")) + row_count = database.execute("SELECT COUNT(*) as count FROM table_history_movie LEFT JOIN table_movies ON " + "table_history_movie.radarrId=table_movies.radarrId " + "WHERE table_movies.title is not NULL", only_one=True)['count'] page = request.GET.page if page == "": page = "1"