From b0fe8164d9554d4c9270107bc570b6292c0a1f42 Mon Sep 17 00:00:00 2001 From: Halali Date: Wed, 20 Mar 2019 22:20:10 +0100 Subject: [PATCH] Change regex for video.series refiner --- bazarr/get_subtitle.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bazarr/get_subtitle.py b/bazarr/get_subtitle.py index 206edda63..f77e8ab7d 100644 --- a/bazarr/get_subtitle.py +++ b/bazarr/get_subtitle.py @@ -23,6 +23,7 @@ from subliminal import region, score as subliminal_scores, \ list_subtitles, Episode, Movie from subliminal_patch.core import SZAsyncProviderPool, download_best_subtitles, save_subtitles, download_subtitles from subliminal_patch.score import compute_score +from subliminal.refiners.tvdb import series_re from get_languages import language_from_alpha3, alpha2_from_alpha3, alpha3_from_alpha2, language_from_alpha2 from bs4 import UnicodeDammit from config import settings @@ -669,7 +670,7 @@ def refine_from_db(path, video): data = c.execute("SELECT table_shows.title, table_episodes.season, table_episodes.episode, table_episodes.title, table_shows.year, table_shows.tvdbId, table_shows.alternateTitles, table_episodes.format, table_episodes.resolution, table_episodes.video_codec, table_episodes.audio_codec FROM table_episodes INNER JOIN table_shows on table_shows.sonarrSeriesId = table_episodes.sonarrSeriesId WHERE table_episodes.path = ?", (unicode(path_replace_reverse(path)),)).fetchone() db.close() if data: - video.series = re.sub(r'(\(\d\d\d\d\))' , '', data[0]) + video.series, year, country = series_re.match(data[0]).groups() video.season = int(data[1]) video.episode = int(data[2]) video.title = data[3]