1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-12 11:02:21 -05:00

Fixed issue with columns not being unique for xem_numbering table.

This commit is contained in:
echel0n 2014-04-21 22:56:30 -07:00
parent ea38289dd8
commit b30ef51b22
2 changed files with 3 additions and 11 deletions

View File

@ -68,11 +68,7 @@ class AddXemNumbering(AddNetworkTimezones):
def execute(self):
self.connection.action(
"CREATE TABLE xem_numbering (indexer TEXT, indexer_id INTEGER PRIMARY KEY, season INTEGER, episode INTEGER, scene_season INTEGER, scene_episode INTEGER)")
self.connection.action(
"CREATE UNIQUE INDEX idx_xem_numbering_indexer_id ON xem_numbering (indexer_id);")
"CREATE TABLE xem_numbering (indexer TEXT, indexer_id INTEGER, season INTEGER, episode INTEGER, scene_season INTEGER, scene_episode INTEGER)")
class AddXemRefresh(AddXemNumbering):
def test(self):
return self.hasTable("xem_refresh")
@ -81,10 +77,6 @@ class AddXemRefresh(AddXemNumbering):
self.connection.action(
"CREATE TABLE xem_refresh (indexer TEXT, indexer_id INTEGER PRIMARY KEY, last_refreshed INTEGER)")
self.connection.action(
"CREATE INDEX idx_xem_refresh_indexer_id ON xem_refresh (indexer_id);")
class ConvertSceneExceptionsToIndexerID(AddXemRefresh):
def test(self):
return self.hasColumn("scene_exceptions", "indexer_id")

View File

@ -299,10 +299,10 @@ def _xem_refresh(indexer_id):
entry['scene_2']['season'], entry['scene_2']['episode']])
else:
logger.log(u'Failed to get XEM scene data for show %s from %s because "%s"' % (
indexer_id, sickbeard.indexerApi(indexer).name, result['message']), logger.MESSAGE)
indexer_id, sickbeard.indexerApi(indexer).name, result['message']), logger.DEBUG)
else:
logger.log(u"Empty lookup result - no XEM data for show %s on %s" % (
indexer_id, sickbeard.indexerApi(indexer).name,), logger.MESSAGE)
indexer_id, sickbeard.indexerApi(indexer).name,), logger.DEBUG)
except Exception, e:
logger.log(u"Exception while refreshing XEM data for show " + str(indexer_id) + " on " + sickbeard.indexerApi(
indexer).name + ": " + ex(e), logger.WARNING)