From b6242c746cfaf3593d3aed08b5b6544873f304ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Fri, 24 Jan 2020 06:33:50 -0500 Subject: [PATCH] WIP --- bazarr/api.py | 3 +++ bazarr/list_subtitles.py | 3 ++- views/episodes.html | 6 +++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bazarr/api.py b/bazarr/api.py index 80538ab93..d7f9b6ead 100644 --- a/bazarr/api.py +++ b/bazarr/api.py @@ -22,6 +22,7 @@ from list_subtitles import store_subtitles, store_subtitles_movie, series_scan_s list_missing_subtitles, list_missing_subtitles_movies from utils import history_log, history_log_movie from get_providers import get_providers, get_providers_auth, list_throttled_providers +from websocket_handler import event_stream from subliminal_patch.core import SUBTITLE_EXTENSIONS @@ -139,6 +140,8 @@ class Series(Resource): list_missing_subtitles(no=seriesId) + event_stream.write(type='series', action='update', series=seriesId) + return '', 204 diff --git a/bazarr/list_subtitles.py b/bazarr/list_subtitles.py index 84afda725..34641d1e0 100644 --- a/bazarr/list_subtitles.py +++ b/bazarr/list_subtitles.py @@ -222,7 +222,8 @@ def list_missing_subtitles(no=None, epno=None): desired_subtitles = desired_subtitles_temp actual_subtitles_list = [] if desired_subtitles is None: - missing_subtitles_global.append(tuple(['[]', episode_subtitles['sonarrEpisodeId']])) + missing_subtitles_global.append(tuple(['[]', episode_subtitles['sonarrEpisodeId'], + episode_subtitles['sonarrSeriesId']])) else: for item in actual_subtitles: if item[0] == "pt-BR": diff --git a/views/episodes.html b/views/episodes.html index f76c06748..e6ca34455 100644 --- a/views/episodes.html +++ b/views/episodes.html @@ -346,7 +346,7 @@ }, {"data": null, "render": function (data) { - if (data.subtitles !== null) { + if (data.subtitles !== 'None') { var languages = ''; data.subtitles.forEach(appendFunc); return languages; @@ -365,7 +365,7 @@ }, {"data": null, "render": function (data) { - if (data.missing_subtitles !== null) { + if (data.missing_subtitles !== 'None') { var languages = ''; data.missing_subtitles.forEach(appendFunc); return languages; @@ -808,7 +808,7 @@ $('#seriesFileCount').text(seriesDetails['episodeFileCount'] + ' files'); var languages = ''; - if (seriesDetails['languages'] !== null) { + if (seriesDetails['languages'] !== 'None') { seriesDetails['languages'].forEach(appendFunc); }