Commit 327b5a30 authored by echel0n's avatar echel0n

Fixed #SICKRAGE-APP-46H - Refactored IMDb ID regex

parent 4b9115bd
......@@ -792,7 +792,7 @@ class TVShow(object):
'imdbid': 'imdb_id'
}
if not re.search(r'tt\d+', self.imdb_id):
if not re.search(r'^tt\d+$', self.imdb_id):
try:
resp = sickrage.app.api.imdb.search_by_imdb_title(self.name)
except APIError as e:
......@@ -802,14 +802,14 @@ class TVShow(object):
for x in resp.get('Search', []):
try:
if int(x.get('Year'), 0) == self.startyear and x.get('Title') in self.name:
if re.search(r'tt\d+', x.get('imdbID', '')):
if re.search(r'^tt\d+$', x.get('imdbID', '')):
self.imdb_id = x.get('imdbID')
self.save()
break
except:
continue
if re.search(r'tt\d+', self.imdb_id):
if re.search(r'^tt\d+$', self.imdb_id):
sickrage.app.log.debug(str(self.indexer_id) + ": Obtaining IMDb info")
try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment