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))