Skip to content

Commit

Permalink
Fixed all the call to generate_subtitles() that were missing a profil…
Browse files Browse the repository at this point in the history
…e_id argument.
  • Loading branch information
morpheus65535 committed Oct 10, 2024
1 parent 367b755 commit 5c8abac
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 7 deletions.
4 changes: 2 additions & 2 deletions bazarr/subtitles/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@


@update_pools
def generate_subtitles(path, languages, audio_language, sceneName, title, media_type, forced_minimum_score=None,
is_upgrade=False, profile_id=None, check_if_still_required=False,
def generate_subtitles(path, languages, audio_language, sceneName, title, media_type, profile_id,
forced_minimum_score=None, is_upgrade=False, check_if_still_required=False,
previous_subtitles_to_delete=None):
if not languages:
return None
Expand Down
4 changes: 3 additions & 1 deletion bazarr/subtitles/mass_download/movies.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ def movies_download_subtitles(no):
TableMovies.sceneName,
TableMovies.title,
TableMovies.tags,
TableMovies.monitored)
TableMovies.monitored,
TableMovies.profileId)
.where(reduce(operator.and_, conditions))) \
.first()
if not movie:
Expand Down Expand Up @@ -79,6 +80,7 @@ def movies_download_subtitles(no):
str(movie.sceneName),
movie.title,
'movie',
movie.profileId,
check_if_still_required=True):

if result:
Expand Down
8 changes: 6 additions & 2 deletions bazarr/subtitles/mass_download/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ def series_download_subtitles(no):
TableShows.title,
TableEpisodes.season,
TableEpisodes.episode,
TableEpisodes.title.label('episodeTitle'))
TableEpisodes.title.label('episodeTitle'),
TableShows.profileId)
.select_from(TableEpisodes)
.join(TableShows)
.where(reduce(operator.and_, conditions))) \
Expand Down Expand Up @@ -87,6 +88,7 @@ def series_download_subtitles(no):
str(episode.sceneName),
episode.title,
'series',
episode.profileId,
check_if_still_required=True):
if result:
if isinstance(result, tuple) and len(result):
Expand Down Expand Up @@ -117,7 +119,8 @@ def episode_download_subtitles(no, send_progress=False):
TableShows.seriesType,
TableEpisodes.title.label('episodeTitle'),
TableEpisodes.season,
TableEpisodes.episode)
TableEpisodes.episode,
TableShows.profileId)
.select_from(TableEpisodes)
.join(TableShows)
.where(reduce(operator.and_, conditions))) \
Expand Down Expand Up @@ -159,6 +162,7 @@ def episode_download_subtitles(no, send_progress=False):
str(episode.sceneName),
episode.title,
'series',
episode.profileId,
check_if_still_required=True):
if result:
if isinstance(result, tuple) and len(result):
Expand Down
2 changes: 2 additions & 0 deletions bazarr/subtitles/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def upgrade_subtitles():
str(episode['sceneName']),
episode['seriesTitle'],
'series',
episode['profileId'],
forced_minimum_score=int(episode['score']),
is_upgrade=True,
previous_subtitles_to_delete=path_mappings.path_replace(
Expand Down Expand Up @@ -192,6 +193,7 @@ def upgrade_subtitles():
str(movie['sceneName']),
movie['title'],
'movie',
movie['profileId'],
forced_minimum_score=int(movie['score']),
is_upgrade=True,
previous_subtitles_to_delete=path_mappings.path_replace_movie(
Expand Down
4 changes: 3 additions & 1 deletion bazarr/subtitles/wanted/movies.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def _wanted_movie(movie):
str(movie.sceneName),
movie.title,
'movie',
movie.profileId,
check_if_still_required=True):

if result:
Expand All @@ -69,7 +70,8 @@ def wanted_download_subtitles_movie(radarr_id):
TableMovies.audio_language,
TableMovies.sceneName,
TableMovies.failedAttempts,
TableMovies.title)
TableMovies.title,
TableMovies.profileId)
.where(TableMovies.radarrId == radarr_id)) \
.all()

Expand Down
4 changes: 3 additions & 1 deletion bazarr/subtitles/wanted/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def _wanted_episode(episode):
str(episode.sceneName),
episode.title,
'series',
episode.profileId,
check_if_still_required=True):
if result:
if isinstance(result, tuple) and len(result):
Expand All @@ -71,7 +72,8 @@ def wanted_download_subtitles(sonarr_episode_id):
TableEpisodes.audio_language,
TableEpisodes.sceneName,
TableEpisodes.failedAttempts,
TableShows.title)
TableShows.title,
TableShows.profileId)
.select_from(TableEpisodes)
.join(TableShows)
.where((TableEpisodes.sonarrEpisodeId == sonarr_episode_id))) \
Expand Down

0 comments on commit 5c8abac

Please sign in to comment.