1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-27 01:57:33 +00:00

Fix for year not matching for series and movies that includes year in directory name.

This commit is contained in:
Louis Vézina 2020-10-06 22:01:22 -04:00
parent 7a2e6ab24f
commit 49e7dfa0f5

View file

@ -1033,7 +1033,7 @@ def refine_from_db(path, video):
"WHERE table_episodes.path = ?", (path_mappings.path_replace_reverse(path),), only_one=True)
if data:
video.series = re.sub(r'(\(\d\d\d\d\))', '', data['seriesTitle'])
video.series = re.sub(r'\s(\(\d\d\d\d\))', '', data['seriesTitle'])
video.season = int(data['season'])
video.episode = int(data['episode'])
video.title = data['episodeTitle']
@ -1056,7 +1056,7 @@ def refine_from_db(path, video):
(path_mappings.path_replace_reverse_movie(path),), only_one=True)
if data:
video.title = re.sub(r'(\(\d\d\d\d\))', '', data['title'])
video.title = re.sub(r'\s(\(\d\d\d\d\))', '', data['title'])
# Commented out because Radarr provided so much bad year
# if data['year']:
# if int(data['year']) > 0: video.year = int(data['year'])