diff --git a/bazarr/main.py b/bazarr/main.py index 6878f1ef8..8c33b04c9 100644 --- a/bazarr/main.py +++ b/bazarr/main.py @@ -830,7 +830,7 @@ def movie(no): c = conn.cursor() movies_details = [] - movies_details = c.execute("SELECT title, overview, poster, fanart, hearing_impaired, tmdbid, audio_language, languages, path_substitution(path), subtitles, radarrId, missing_subtitles, sceneName, monitored FROM table_movies WHERE radarrId LIKE ?", (str(no),)).fetchone() + movies_details = c.execute("SELECT title, overview, poster, fanart, hearing_impaired, tmdbid, audio_language, languages, path_substitution(path), subtitles, radarrId, missing_subtitles, sceneName, monitored, failedAttempts FROM table_movies WHERE radarrId LIKE ?", (str(no),)).fetchone() tmdbid = movies_details[5] languages = c.execute("SELECT code2, name FROM table_settings_languages WHERE enabled = 1").fetchall() @@ -1017,7 +1017,7 @@ def wantedmovies(): offset = (int(page) - 1) * page_size max_page = int(math.ceil(missing_count / (page_size + 0.0))) - c.execute("SELECT title, missing_subtitles, radarrId, path_substitution(path), hearing_impaired, sceneName FROM table_movies WHERE missing_subtitles != '[]'" + monitored_only_query_string + " ORDER BY _rowid_ DESC LIMIT ? OFFSET ?", (page_size, offset,)) + c.execute("SELECT title, missing_subtitles, radarrId, path_substitution(path), hearing_impaired, sceneName, failedAttempts FROM table_movies WHERE missing_subtitles != '[]'" + monitored_only_query_string + " ORDER BY _rowid_ DESC LIMIT ? OFFSET ?", (page_size, offset,)) data = c.fetchall() c.close() return template('wantedmovies', __file__=__file__, bazarr_version=bazarr_version, rows=data, missing_count=missing_count, page=page, max_page=max_page, base_url=base_url, page_size=page_size, current_port=port) diff --git a/views/movie.tpl b/views/movie.tpl index d32d27889..0edaf75ab 100644 --- a/views/movie.tpl +++ b/views/movie.tpl @@ -170,7 +170,8 @@ <% - missing_subs_languages = ast.literal_eval(str(details[11])) + missing_subs_languages = ast.literal_eval(details[11]) + from get_subtitle import search_active if missing_subs_languages is not None: %> @@ -182,12 +183,32 @@
<% for missing_subs_language in missing_subs_languages: + if details[14] is not None and get_general_settings()[25]: + for lang in ast.literal_eval(details[14]): + if missing_subs_language in lang: + if search_active(lang[1]): %> {{language_from_alpha2(str(missing_subs_language))}} + %else: + + {{language_from_alpha2(str(missing_subs_language))}} + + <% + end + end + end + else: + %> + + {{language_from_alpha2(str(missing_subs_language))}} + + + <% + end end end %> diff --git a/views/wantedmovies.tpl b/views/wantedmovies.tpl index 67299e07c..f459d1a0e 100644 --- a/views/wantedmovies.tpl +++ b/views/wantedmovies.tpl @@ -65,17 +65,41 @@ No missing movie subtitles. %end - %for row in rows: + %for row in rows: {{row[0]}} - %missing_languages = ast.literal_eval(row[1]) - %if missing_languages is not None: - %for language in missing_languages: - - {{language}} - - + <% + missing_languages = ast.literal_eval(row[1]) + if missing_languages is not None: + from get_subtitle import search_active + from get_settings import get_general_settings + for language in missing_languages: + if row[6] is not None and get_general_settings()[25]: + for lang in ast.literal_eval(row[6]): + if language in lang: + active = search_active(lang[1]) + if active: + %> + + {{language}} + + + %else: + + {{language}} + + + %end + %end + %end + %else: + + {{language}} + + + %end + %end %end