1
0
mirror of https://github.com/moparisthebest/SickRage synced 2025-01-06 03:18:01 -05:00

Possible fix for issue #954

This commit is contained in:
echel0n 2014-12-02 04:59:26 -08:00
parent e5af1cb4ff
commit 35c84c9449
3 changed files with 10 additions and 12 deletions

View File

@ -118,14 +118,11 @@ class DBConnection(object):
else:
return 0
def mass_action(self, querylist, logTransaction=False, fetchall=False):
def mass_action(self, querylist=[], logTransaction=False, fetchall=False):
with db_lock:
# remove None types
querylist = [i for i in querylist if i != None]
if querylist == None:
return
querylist = [i for i in querylist if i is not None]
sqlResult = []
attempt = 0

View File

@ -520,7 +520,7 @@ class QueueItemUpdate(ShowQueueItem):
try:
self.show.saveToDB()
except Exception, e:
logger.log(u"Error saving the episode to the database: " + ex(e), logger.ERROR)
logger.log(u"Error saving show info to the database: " + ex(e), logger.ERROR)
logger.log(traceback.format_exc(), logger.DEBUG)
# get episode list from DB
@ -537,7 +537,7 @@ class QueueItemUpdate(ShowQueueItem):
IndexerEpList = None
foundMissingEps = False
if IndexerEpList == None:
if IndexerEpList is None:
logger.log(u"No data returned from " + sickbeard.indexerApi(
self.show.indexer).name + ", unable to update this show", logger.ERROR)
else:

View File

@ -282,10 +282,10 @@ class TVShow(object):
cur_indexerid = self.indexerid
# In some situations self.status = None.. need to figure out where that is!
if not self.status:
self.status = ''
logger.log("Status missing for showid: [%s] with status: [%s]" %
(cur_indexerid, self.status), logger.DEBUG)
#if not self.status:
# self.status = ''
# logger.log("Status missing for showid: [%s] with status: [%s]" %
# (cur_indexerid, self.status), logger.DEBUG)
# if show is not 'Ended' always update (status 'Continuing' or '')
if 'Ended' not in self.status:
@ -580,6 +580,7 @@ class TVShow(object):
# Done updating save last update date
self.last_update_indexer = datetime.date.today().toordinal()
self.saveToDB()
return scannedEps
@ -719,7 +720,7 @@ class TVShow(object):
elif oldStatus not in (SNATCHED, SNATCHED_PROPER):
newStatus = DOWNLOADED
if newStatus != None:
if newStatus is not None:
with curEp.lock:
logger.log(u"STATUS: we have an associated file, so setting the status from " + str(
curEp.status) + u" to DOWNLOADED/" + str(Quality.statusFromName(file, anime=self.is_anime)),