diff --git a/sickbeard/db.py b/sickbeard/db.py index b629a7d1..50f25098 100644 --- a/sickbeard/db.py +++ b/sickbeard/db.py @@ -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 diff --git a/sickbeard/show_queue.py b/sickbeard/show_queue.py index d0cb2be7..f76b0491 100644 --- a/sickbeard/show_queue.py +++ b/sickbeard/show_queue.py @@ -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: diff --git a/sickbeard/tv.py b/sickbeard/tv.py index c75bab1c..9d31fdce 100644 --- a/sickbeard/tv.py +++ b/sickbeard/tv.py @@ -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)),