Private GIT

Skip to content
Snippets Groups Projects
Commit 84ce961a authored by Dustyn Gibson's avatar Dustyn Gibson
Browse files

Fix snatching when abd series has an episode and special on the same date

parent 62d0eba7
No related branches found
No related tags found
No related merge requests found
...@@ -412,6 +412,7 @@ class GenericProvider(object): ...@@ -412,6 +412,7 @@ class GenericProvider(object):
actual_season = parse_result.season_number actual_season = parse_result.season_number
actual_episodes = parse_result.episode_numbers actual_episodes = parse_result.episode_numbers
else: else:
sameDaySpecial = False
if not parse_result.is_air_by_date: if not parse_result.is_air_by_date:
logger.log( logger.log(
u"This is supposed to be a date search but the result " + title + " didn't parse as one, skipping it", u"This is supposed to be a date search but the result " + title + " didn't parse as one, skipping it",
...@@ -424,13 +425,22 @@ class GenericProvider(object): ...@@ -424,13 +425,22 @@ class GenericProvider(object):
"SELECT season, episode FROM tv_episodes WHERE showid = ? AND airdate = ?", "SELECT season, episode FROM tv_episodes WHERE showid = ? AND airdate = ?",
[showObj.indexerid, airdate]) [showObj.indexerid, airdate])
if len(sql_results) != 1: if len(sql_results) == 2:
if int(sql_results[0]['season']) == 0 and int(sql_results[1]['season']) != 0:
actual_season = int(sql_results[1]["season"])
actual_episodes = [int(sql_results[1]["episode"])]
sameDaySpecial = True
elif int(sql_results[1]['season']) == 0 and int(sql_results[0]['season']) != 0:
actual_season = int(sql_results[0]["season"])
actual_episodes = [int(sql_results[0]["episode"])]
sameDaySpecial = True
elif len(sql_results) != 1:
logger.log( logger.log(
u"Tried to look up the date for the episode " + title + " but the database didn't give proper results, skipping it", u"Tried to look up the date for the episode " + title + " but the database didn't give proper results, skipping it",
logger.WARNING) logger.WARNING)
addCacheEntry = True addCacheEntry = True
if not addCacheEntry: if not addCacheEntry and not sameDaySpecial:
actual_season = int(sql_results[0]["season"]) actual_season = int(sql_results[0]["season"])
actual_episodes = [int(sql_results[0]["episode"])] actual_episodes = [int(sql_results[0]["episode"])]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment