From c5c562ee9389b4e562df3b56bae1e9968b700842 Mon Sep 17 00:00:00 2001 From: Dustyn Gibson <miigotu@gmail.com> Date: Tue, 17 Nov 2015 19:20:10 -0800 Subject: [PATCH] Fix snatching when abd series has an episode and special on the same date --- sickbeard/providers/generic.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sickbeard/providers/generic.py b/sickbeard/providers/generic.py index ff2cadc27..61a9dc5bd 100644 --- a/sickbeard/providers/generic.py +++ b/sickbeard/providers/generic.py @@ -412,6 +412,7 @@ class GenericProvider(object): actual_season = parse_result.season_number actual_episodes = parse_result.episode_numbers else: + sameDaySpecial = False if not parse_result.is_air_by_date: logger.log( 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): "SELECT season, episode FROM tv_episodes WHERE showid = ? AND 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( u"Tried to look up the date for the episode " + title + " but the database didn't give proper results, skipping it", logger.WARNING) addCacheEntry = True - if not addCacheEntry: + if not addCacheEntry and not sameDaySpecial: actual_season = int(sql_results[0]["season"]) actual_episodes = [int(sql_results[0]["episode"])] -- GitLab