diff options
author | morpheus65535 <[email protected]> | 2024-12-14 00:02:06 -0500 |
---|---|---|
committer | morpheus65535 <[email protected]> | 2024-12-14 00:02:06 -0500 |
commit | cf559d1028803dad83921f2b61162199bb1fb27f (patch) | |
tree | 17beab60a073aa6660238577a4a097ab6cdc768d | |
parent | 4df822d363b448b98000b6c4c6de054d8faa45e4 (diff) | |
download | bazarr-cf559d1028803dad83921f2b61162199bb1fb27f.tar.gz bazarr-cf559d1028803dad83921f2b61162199bb1fb27f.zip |
Fixed improperly guessed video episode number while refining. #2784
-rw-r--r-- | bazarr/subtitles/refiners/database.py | 6 | ||||
-rw-r--r-- | 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 |