mirror of
https://github.com/moparisthebest/SickRage
synced 2025-01-07 11:58:01 -05:00
Possible fix for issue #954
This commit is contained in:
parent
e5af1cb4ff
commit
35c84c9449
@ -118,14 +118,11 @@ class DBConnection(object):
|
|||||||
else:
|
else:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def mass_action(self, querylist, logTransaction=False, fetchall=False):
|
def mass_action(self, querylist=[], logTransaction=False, fetchall=False):
|
||||||
|
|
||||||
with db_lock:
|
with db_lock:
|
||||||
# remove None types
|
# remove None types
|
||||||
querylist = [i for i in querylist if i != None]
|
querylist = [i for i in querylist if i is not None]
|
||||||
|
|
||||||
if querylist == None:
|
|
||||||
return
|
|
||||||
|
|
||||||
sqlResult = []
|
sqlResult = []
|
||||||
attempt = 0
|
attempt = 0
|
||||||
|
@ -520,7 +520,7 @@ class QueueItemUpdate(ShowQueueItem):
|
|||||||
try:
|
try:
|
||||||
self.show.saveToDB()
|
self.show.saveToDB()
|
||||||
except Exception, e:
|
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)
|
logger.log(traceback.format_exc(), logger.DEBUG)
|
||||||
|
|
||||||
# get episode list from DB
|
# get episode list from DB
|
||||||
@ -537,7 +537,7 @@ class QueueItemUpdate(ShowQueueItem):
|
|||||||
IndexerEpList = None
|
IndexerEpList = None
|
||||||
|
|
||||||
foundMissingEps = False
|
foundMissingEps = False
|
||||||
if IndexerEpList == None:
|
if IndexerEpList is None:
|
||||||
logger.log(u"No data returned from " + sickbeard.indexerApi(
|
logger.log(u"No data returned from " + sickbeard.indexerApi(
|
||||||
self.show.indexer).name + ", unable to update this show", logger.ERROR)
|
self.show.indexer).name + ", unable to update this show", logger.ERROR)
|
||||||
else:
|
else:
|
||||||
|
@ -282,10 +282,10 @@ class TVShow(object):
|
|||||||
cur_indexerid = self.indexerid
|
cur_indexerid = self.indexerid
|
||||||
|
|
||||||
# In some situations self.status = None.. need to figure out where that is!
|
# In some situations self.status = None.. need to figure out where that is!
|
||||||
if not self.status:
|
#if not self.status:
|
||||||
self.status = ''
|
# self.status = ''
|
||||||
logger.log("Status missing for showid: [%s] with status: [%s]" %
|
# logger.log("Status missing for showid: [%s] with status: [%s]" %
|
||||||
(cur_indexerid, self.status), logger.DEBUG)
|
# (cur_indexerid, self.status), logger.DEBUG)
|
||||||
|
|
||||||
# if show is not 'Ended' always update (status 'Continuing' or '')
|
# if show is not 'Ended' always update (status 'Continuing' or '')
|
||||||
if 'Ended' not in self.status:
|
if 'Ended' not in self.status:
|
||||||
@ -580,6 +580,7 @@ class TVShow(object):
|
|||||||
|
|
||||||
# Done updating save last update date
|
# Done updating save last update date
|
||||||
self.last_update_indexer = datetime.date.today().toordinal()
|
self.last_update_indexer = datetime.date.today().toordinal()
|
||||||
|
|
||||||
self.saveToDB()
|
self.saveToDB()
|
||||||
|
|
||||||
return scannedEps
|
return scannedEps
|
||||||
@ -719,7 +720,7 @@ class TVShow(object):
|
|||||||
elif oldStatus not in (SNATCHED, SNATCHED_PROPER):
|
elif oldStatus not in (SNATCHED, SNATCHED_PROPER):
|
||||||
newStatus = DOWNLOADED
|
newStatus = DOWNLOADED
|
||||||
|
|
||||||
if newStatus != None:
|
if newStatus is not None:
|
||||||
with curEp.lock:
|
with curEp.lock:
|
||||||
logger.log(u"STATUS: we have an associated file, so setting the status from " + str(
|
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)),
|
curEp.status) + u" to DOWNLOADED/" + str(Quality.statusFromName(file, anime=self.is_anime)),
|
||||||
|
Loading…
Reference in New Issue
Block a user