Private GIT

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

Daily and Backlog not honoring paused parameter - fixes SiCKRAGETV/sickrage-issues#1953

parent 39afdc0b
No related branches found
No related tags found
No related merge requests found
......@@ -40,6 +40,8 @@ class DailySearcher():
self.amActive = False
def run(self, force=False):
if self.amActive:
return
self.amActive = True
......
......@@ -321,19 +321,14 @@ def isFirstBestMatch(result):
return False
def wantedEpisodes(show, fromDate):
anyQualities, bestQualities = common.Quality.splitQuality(show.quality) # @UnusedVariable
allQualities = list(set(anyQualities + bestQualities))
logger.log(u"Seeing if we need anything from " + show.name, logger.DEBUG)
myDB = db.DBConnection()
if show.air_by_date:
sqlResults = myDB.select(
"SELECT ep.status, ep.season, ep.episode FROM tv_episodes ep, tv_shows show WHERE season != 0 AND ep.showid = show.indexer_id AND show.paused = 0 AND ep.airdate > ? AND ep.showid = ? AND show.air_by_date = 1",
[fromDate.toordinal(), show.indexerid])
else:
sqlResults = myDB.select(
"SELECT status, season, episode FROM tv_episodes WHERE showid = ? AND season > 0 and airdate > ?",
sqlResults = myDB.select("SELECT status, season, episode FROM tv_episodes WHERE showid = ? AND season > 0 and airdate > ?",
[show.indexerid, fromDate.toordinal()])
# check through the list of statuses to see if we want any
......
......@@ -74,6 +74,9 @@ class BacklogSearcher:
logger.log(u"Backlog is still running, not starting it again", logger.DEBUG)
return
self.amActive = True
self.amPaused = False
if which_shows:
show_list = which_shows
else:
......@@ -84,13 +87,10 @@ class BacklogSearcher:
curDate = datetime.date.today().toordinal()
fromDate = datetime.date.fromordinal(1)
if not which_shows and not curDate - self._lastBacklog >= self.cycleTime:
if not which_shows and not ((curDate - self._lastBacklog) >= self.cycleTime):
logger.log(u"Running limited backlog on missed episodes " + str(sickbeard.BACKLOG_DAYS) + " day(s) and older only")
fromDate = datetime.date.today() - datetime.timedelta(days=sickbeard.BACKLOG_DAYS)
self.amActive = True
self.amPaused = False
# go through non air-by-date shows and see if they need any episodes
for curShow in show_list:
......@@ -135,19 +135,17 @@ class BacklogSearcher:
return self._lastBacklog
def _get_segments(self, show, fromDate):
if show.paused:
logger.log(u"Skipping backlog for {show_name} because the show is paused".format(show_name=show.name), logger.DEBUG)
return {}
anyQualities, bestQualities = common.Quality.splitQuality(show.quality) # @UnusedVariable
logger.log(u"Seeing if we need anything from {show_name}".format(show_name=show.name), logger.DEBUG)
myDB = db.DBConnection()
if show.air_by_date:
sqlResults = myDB.select(
"SELECT ep.status, ep.season, ep.episode FROM tv_episodes ep, tv_shows show WHERE season != 0 AND ep.showid = show.indexer_id AND show.paused = 0 AND ep.airdate > ? AND ep.showid = ? AND show.air_by_date = 1",
sqlResults = myDB.select("SELECT status, season, episode FROM tv_episodes WHERE season > 0 AND airdate > ? AND showid = ?",
[fromDate.toordinal(), show.indexerid])
else:
sqlResults = myDB.select(
"SELECT status, season, episode FROM tv_episodes WHERE showid = ? AND season > 0 and airdate > ?",
[show.indexerid, fromDate.toordinal()])
# check through the list of statuses to see if we want any
wanted = {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment