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

pull/1173/head
Louis Vézina 4 years ago
parent 7a2e6ab24f
commit 49e7dfa0f5

@ -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'])

Loading…
Cancel
Save