From cf559d1028803dad83921f2b61162199bb1fb27f Mon Sep 17 00:00:00 2001 From: morpheus65535 Date: Sat, 14 Dec 2024 00:02:06 -0500 Subject: Fixed improperly guessed video episode number while refining. #2784 --- bazarr/subtitles/refiners/database.py | 6 ++---- bazarr/subtitles/utils.py | 5 +---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/bazarr/subtitles/refiners/database.py b/bazarr/subtitles/refiners/database.py index 9eef9f2d8..2b91b0967 100644 --- a/bazarr/subtitles/refiners/database.py +++ b/bazarr/subtitles/refiners/database.py @@ -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 diff --git a/bazarr/subtitles/utils.py b/bazarr/subtitles/utils.py index cfa96e1ed..5370c4bec 100644 --- a/bazarr/subtitles/utils.py +++ b/bazarr/subtitles/utils.py @@ -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) @@ -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 -- cgit v1.2.3