Fixed issue with some DB queries and PostgreSQL.

pull/2786/head
morpheus65535 1 month ago
parent 669ed069f5
commit d7f06bb707

@ -36,7 +36,7 @@ class Badges(Resource):
def get(self):
"""Get badges count to update the UI"""
episodes_conditions = [(TableEpisodes.missing_subtitles.is_not(None)),
(TableEpisodes.missing_subtitles.is_not('[]'))]
(TableEpisodes.missing_subtitles != '[]')]
episodes_conditions += get_exclusion_clause('series')
missing_episodes = database.execute(
select(TableEpisodes.missing_subtitles)
@ -49,7 +49,7 @@ class Badges(Resource):
missing_episodes_count += len(ast.literal_eval(episode.missing_subtitles))
movies_conditions = [(TableMovies.missing_subtitles.is_not(None)),
(TableMovies.missing_subtitles.is_not('[]'))]
(TableMovies.missing_subtitles != '[]')]
movies_conditions += get_exclusion_clause('movie')
missing_movies = database.execute(
select(TableMovies.missing_subtitles)

@ -49,7 +49,7 @@ class EpisodesWanted(Resource):
episodeid = args.get('episodeid[]')
wanted_conditions = [(TableEpisodes.missing_subtitles.is_not(None)),
(TableEpisodes.missing_subtitles.is_not('[]'))]
(TableEpisodes.missing_subtitles != '[]')]
if len(episodeid) > 0:
wanted_conditions.append((TableEpisodes.sonarrEpisodeId in episodeid))
start = 0

@ -46,7 +46,7 @@ class MoviesWanted(Resource):
radarrid = args.get("radarrid[]")
wanted_conditions = [(TableMovies.missing_subtitles.is_not(None)),
(TableMovies.missing_subtitles.is_not('[]'))]
(TableMovies.missing_subtitles != '[]')]
if len(radarrid) > 0:
wanted_conditions.append((TableMovies.radarrId.in_(radarrid)))
start = 0

@ -74,7 +74,7 @@ class Series(Resource):
.subquery()
episodes_missing_conditions = [(TableEpisodes.missing_subtitles.is_not(None)),
(TableEpisodes.missing_subtitles.is_not('[]'))]
(TableEpisodes.missing_subtitles != '[]')]
episodes_missing_conditions += get_exclusion_clause('series')
episodeMissingCount = select(TableShows.sonarrSeriesId,

@ -20,7 +20,7 @@ from ..download import generate_subtitles
def movies_download_subtitles(no):
conditions = [(TableMovies.radarrId.is_(no))]
conditions = [(TableMovies.radarrId == no)]
conditions += get_exclusion_clause('movie')
stmt = select(TableMovies.path,
TableMovies.missing_subtitles,

@ -29,7 +29,7 @@ def series_download_subtitles(no):
raise OSError
conditions = [(TableEpisodes.sonarrSeriesId == no),
(TableEpisodes.missing_subtitles.is_not('[]'))]
(TableEpisodes.missing_subtitles != '[]')]
conditions += get_exclusion_clause('series')
episodes_details = database.execute(
select(TableEpisodes.sonarrEpisodeId,

@ -97,7 +97,7 @@ def wanted_download_subtitles_movie(radarr_id):
def wanted_search_missing_subtitles_movies():
conditions = [(TableMovies.missing_subtitles.is_not(None)),
(TableMovies.missing_subtitles.is_not('[]'))]
(TableMovies.missing_subtitles != '[]')]
conditions += get_exclusion_clause('movie')
movies = database.execute(
select(TableMovies.radarrId,

@ -102,7 +102,7 @@ def wanted_download_subtitles(sonarr_episode_id):
def wanted_search_missing_subtitles_series():
conditions = [(TableEpisodes.missing_subtitles.is_not(None)),
(TableEpisodes.missing_subtitles.is_not('[]'))]
(TableEpisodes.missing_subtitles != '[]')]
conditions += get_exclusion_clause('series')
episodes = database.execute(
select(TableEpisodes.sonarrSeriesId,

Loading…
Cancel
Save