From 1d9dec6b20579254cc7a9952a7d41207fa6af589 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Tue, 5 Feb 2019 06:57:45 -0500 Subject: [PATCH] Remove (year) from movie and series title. --- bazarr/get_subtitle.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bazarr/get_subtitle.py b/bazarr/get_subtitle.py index ebc523067..02e7ec5f2 100644 --- a/bazarr/get_subtitle.py +++ b/bazarr/get_subtitle.py @@ -11,6 +11,7 @@ import cPickle as pickle import codecs import types import chardet +import re import subliminal import subliminal_patch from ast import literal_eval @@ -689,7 +690,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 FROM table_episodes INNER JOIN table_shows on table_shows.sonarrSeriesId = table_episodes.sonarrSeriesId WHERE table_episodes.path = ?", (path_replace_reverse(path),)).fetchone() db.close() if data != None: - video.series = data[0] + video.series = re.sub(r'(\(\d\d\d\d\))' , '', data[0]) video.season = int(data[1]) video.episode = int(data[2]) video.title = data[3] @@ -703,7 +704,7 @@ def refine_from_db(path, video): data = c.execute("SELECT title, year, alternativeTitles FROM table_movies WHERE path = ?", (path_replace_reverse_movie(path),)).fetchone() db.close() if data != None: - video.title = data[0] + video.title = re.sub(r'(\(\d\d\d\d\))' , '', data[0]) if int(data[1]) > 0: video.year = int(data[1]) video.alternative_titles = ast.literal_eval(data[2])