Skip to content

Commit

Permalink
Fixed improperly guessed video episode number while refining. #2784
Browse files Browse the repository at this point in the history
  • Loading branch information
morpheus65535 committed Dec 14, 2024
1 parent 4df822d commit cf559d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
6 changes: 2 additions & 4 deletions bazarr/subtitles/refiners/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@ def refine_from_db(path, video):

if data:
video.series = _TITLE_RE.sub('', data.seriesTitle)
if not video.season and data.season:
video.season = int(data.season)
if not video.episode and data.episode:
video.episode = int(data.episode)
video.season = int(data.season)
video.episode = int(data.episode)
video.title = data.episodeTitle

# Only refine year as a fallback
Expand Down
5 changes: 1 addition & 4 deletions bazarr/subtitles/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ def get_video(path, title, sceneName, providers=None, media_type="movie"):
logging.debug('BAZARR resulting video object once refined using scene name: %s',
json.dumps(vars(video), cls=GuessitEncoder, indent=4, ensure_ascii=False))

video.original_name = os.path.basename(path)
video.original_path = path

for key, refiner in registered_refiners.items():
logging.debug("Running refiner: %s", key)
refiner(path, video)
Expand Down Expand Up @@ -107,6 +104,6 @@ def _set_forced_providers(pool, also_forced=False, forced_required=False):

def refine_video_with_scenename(initial_video, scenename_video):
for key, value in vars(scenename_video).items():
if value:
if value and getattr(initial_video, key) in [None, (), {}, []]:
setattr(initial_video, key, value)
return initial_video

0 comments on commit cf559d1

Please sign in to comment.