Skip to content

Commit

Permalink
Fixed the subtitles upgrade process loop for normal subtitles upgrade…
Browse files Browse the repository at this point in the history
…d to HI subtitles.
  • Loading branch information
morpheus65535 committed Jul 3, 2024
1 parent 3cbfe08 commit a4527a7
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions bazarr/subtitles/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,12 @@ def upgrade_subtitles():
.join(TableEpisodes, onclause=TableHistory.sonarrEpisodeId == TableEpisodes.sonarrEpisodeId)
.join(episodes_to_upgrade, onclause=TableHistory.id == episodes_to_upgrade.c.id, isouter=True)
.where(episodes_to_upgrade.c.id.is_not(None)))
.all() if _language_still_desired(x.language, x.profileId)]
.all() if _language_still_desired(x.language, x.profileId) and
x.subtitles_path in x.external_subtitles and
x.video_path == x.path
]

for item in episodes_data:
if item['upgradable']:
if item['subtitles_path'] not in item['external_subtitles'] or \
not item['video_path'] == item['path']:
item.update({"upgradable": False})

del item['path']
del item['external_subtitles']

Expand Down Expand Up @@ -156,14 +154,12 @@ def upgrade_subtitles():
.join(TableMovies, onclause=TableHistoryMovie.radarrId == TableMovies.radarrId)
.join(movies_to_upgrade, onclause=TableHistoryMovie.id == movies_to_upgrade.c.id, isouter=True)
.where(movies_to_upgrade.c.id.is_not(None)))
.all() if _language_still_desired(x.language, x.profileId)]
.all() if _language_still_desired(x.language, x.profileId) and
x.subtitles_path in x.external_subtitles and
x.video_path == x.path
]

for item in movies_data:
if item['upgradable']:
if item['subtitles_path'] not in item['external_subtitles'] or \
not item['video_path'] == item['path']:
item.update({"upgradable": False})

del item['path']
del item['external_subtitles']

Expand Down

0 comments on commit a4527a7

Please sign in to comment.