Commit 26b7be11 authored by echel0n's avatar echel0n

Fixed NoneType issue with delete and update database function calls.

parent aaf7acf9
# Changelog
- * cb8e054 - 2018-11-12: Refactored new version string to web socket message.
- * 1df177b - 2018-11-14: Fixed NoneType issue with delete and update database function calls.
- * aaf7acf - 2018-11-12: Refactored new version string to web socket message.
- * d831f6f - 2018-11-12: Release v9.4.32
- * f298b17 - 2018-11-12: Refactored speed.cd torrent provider to use cookie login.
- * 2abdafe - 2018-11-12: Release v9.4.31
......
......@@ -83,7 +83,9 @@ class BlackAndWhiteList(object):
:param table: database table remove keywords from
"""
sickrage.app.main_db.delete(sickrage.app.main_db.get(table, self.show_id))
dbData = sickrage.app.main_db.get(table, self.show_id)
if dbData:
sickrage.app.main_db.delete(sickrage.app.main_db.get(table, self.show_id))
def _load_list(self, table):
......
......@@ -163,5 +163,6 @@ class BacklogSearcher(object):
sickrage.app.log.debug("Setting the last backlog in the DB to {}".format(when))
dbData = sickrage.app.main_db.get('tv_shows', showid)
dbData['last_backlog_search'] = when
sickrage.app.main_db.update(dbData)
if dbData:
dbData['last_backlog_search'] = when
sickrage.app.main_db.update(dbData)
\ No newline at end of file
......@@ -295,8 +295,9 @@ class ProperSearcher(object):
sickrage.app.log.debug("Setting the last proper search in database to " + str(when))
dbData = sickrage.app.main_db.get('tv_shows', showid)
dbData['last_proper_search'] = when
sickrage.app.main_db.update(dbData)
if dbData:
dbData['last_proper_search'] = when
sickrage.app.main_db.update(dbData)
@staticmethod
def _get_lastProperSearch(showid):
......
......@@ -1043,7 +1043,8 @@ class TVShow(object):
sickrage.app.main_db.insert(imdb_info)
except RevConflict:
dbData = sickrage.app.main_db.get('imdb_info', self.indexerid)
sickrage.app.main_db.delete(dbData)
if dbData:
sickrage.app.main_db.delete(dbData)
imdb_info.update(self.imdb_info)
sickrage.app.main_db.insert(imdb_info)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment