diff options
author | morpheus65535 <[email protected]> | 2022-01-19 07:58:31 -0500 |
---|---|---|
committer | morpheus65535 <[email protected]> | 2022-01-19 07:58:31 -0500 |
commit | 6b82a734e2bc597b219472774c0ec58038630c65 (patch) | |
tree | 92e8f23635f8b7209e35983581450c5bec960256 | |
parent | 391892fdf0450cb30c6ce95ff0c006f6bcaf5a8f (diff) | |
download | bazarr-6b82a734e2bc597b219472774c0ec58038630c65.tar.gz bazarr-6b82a734e2bc597b219472774c0ec58038630c65.zip |
Fixed issue where episode name was used as hints for guessit instead of series name.v1.0.3-beta.14
-rw-r--r-- | bazarr/api/episodes/episodes_subtitles.py | 9 | ||||
-rw-r--r-- | bazarr/api/providers/providers_episodes.py | 11 | ||||
-rw-r--r-- | bazarr/get_subtitle/upgrade.py | 2 |
3 files changed, 12 insertions, 10 deletions
diff --git a/bazarr/api/episodes/episodes_subtitles.py b/bazarr/api/episodes/episodes_subtitles.py index beac35cd9..05ce17425 100644 --- a/bazarr/api/episodes/episodes_subtitles.py +++ b/bazarr/api/episodes/episodes_subtitles.py @@ -6,7 +6,7 @@ from flask import request from flask_restful import Resource from subliminal_patch.core import SUBTITLE_EXTENSIONS -from database import TableEpisodes, get_audio_profile_languages, get_profile_id +from database import TableShows, TableEpisodes, get_audio_profile_languages, get_profile_id from ..utils import authenticate from helper import path_mappings from get_subtitle.upload import manual_upload_subtitle @@ -26,10 +26,11 @@ class EpisodesSubtitles(Resource): def patch(self): sonarrSeriesId = request.args.get('seriesid') sonarrEpisodeId = request.args.get('episodeid') - episodeInfo = TableEpisodes.select(TableEpisodes.title, - TableEpisodes.path, + episodeInfo = TableEpisodes.select(TableEpisodes.path, TableEpisodes.scene_name, - TableEpisodes.audio_language)\ + TableEpisodes.audio_language, + TableShows.title) \ + .join(TableShows, on=(TableEpisodes.sonarrSeriesId == TableShows.sonarrSeriesId)) \ .where(TableEpisodes.sonarrEpisodeId == sonarrEpisodeId)\ .dicts()\ .get() diff --git a/bazarr/api/providers/providers_episodes.py b/bazarr/api/providers/providers_episodes.py index b0eca9e65..28d5b180f 100644 --- a/bazarr/api/providers/providers_episodes.py +++ b/bazarr/api/providers/providers_episodes.py @@ -20,9 +20,9 @@ class ProviderEpisodes(Resource): def get(self): # Manual Search sonarrEpisodeId = request.args.get('episodeid') - episodeInfo = TableEpisodes.select(TableEpisodes.title, - TableEpisodes.path, + episodeInfo = TableEpisodes.select(TableEpisodes.path, TableEpisodes.scene_name, + TableShows.title, TableShows.profileId) \ .join(TableShows, on=(TableEpisodes.sonarrSeriesId == TableShows.sonarrSeriesId))\ .where(TableEpisodes.sonarrEpisodeId == sonarrEpisodeId) \ @@ -46,9 +46,10 @@ class ProviderEpisodes(Resource): # Manual Download sonarrSeriesId = request.args.get('seriesid') sonarrEpisodeId = request.args.get('episodeid') - episodeInfo = TableEpisodes.select(TableEpisodes.title, - TableEpisodes.path, - TableEpisodes.scene_name) \ + episodeInfo = TableEpisodes.select(TableEpisodes.path, + TableEpisodes.scene_name, + TableShows.title) \ + .join(TableShows, on=(TableEpisodes.sonarrSeriesId == TableShows.sonarrSeriesId)) \ .where(TableEpisodes.sonarrEpisodeId == sonarrEpisodeId) \ .dicts() \ .get() diff --git a/bazarr/get_subtitle/upgrade.py b/bazarr/get_subtitle/upgrade.py index b8d01bd80..c1df93a8d 100644 --- a/bazarr/get_subtitle/upgrade.py +++ b/bazarr/get_subtitle/upgrade.py @@ -158,7 +158,7 @@ def upgrade_subtitles(): [(language, is_hi, is_forced)], audio_language, str(episode['scene_name']), - episode['title'], + episode['seriesTitle'], 'series', forced_minimum_score=int(episode['score']), is_upgrade=True)) |