mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-13 03:22:22 -05:00
Added code to convert Indexers from string format to new integer format
This commit is contained in:
parent
a65e68837c
commit
e8fd2d20b3
@ -103,3 +103,11 @@ class ConvertSceneNamesToIndexerID(ConvertSceneExceptionsToIndexerID):
|
|||||||
self.connection.action("INSERT INTO scene_names(indexer_id, name) SELECT tvdb_id, name FROM tmp_scene_names")
|
self.connection.action("INSERT INTO scene_names(indexer_id, name) SELECT tvdb_id, name FROM tmp_scene_names")
|
||||||
self.connection.action("DROP TABLE tmp_scene_names")
|
self.connection.action("DROP TABLE tmp_scene_names")
|
||||||
|
|
||||||
|
class ConvertIndexerToInteger(ConvertSceneNamesToIndexerID):
|
||||||
|
def execute(self):
|
||||||
|
ql = []
|
||||||
|
ql.append(["UPDATE xem_numbering SET indexer = ? WHERE LOWER(indexer) = ?", ["1", "tvdb"]])
|
||||||
|
ql.append(["UPDATE xem_numbering SET indexer = ? WHERE LOWER(indexer) = ?", ["2", "tvrage"]])
|
||||||
|
ql.append(["UPDATE xem_refresh SET indexer = ? WHERE LOWER(indexer) = ?", ["1", "tvdb"]])
|
||||||
|
ql.append(["UPDATE xem_refresh SET indexer = ? WHERE LOWER(indexer) = ?", ["2", "tvrage"]])
|
||||||
|
self.connection.mass_action(ql)
|
||||||
|
@ -643,4 +643,22 @@ class AddSceneNumbering(AddArchiveFirstMatchOption):
|
|||||||
self.connection.action(
|
self.connection.action(
|
||||||
"CREATE TABLE scene_numbering (indexer TEXT, indexer_id INTEGER, season INTEGER, episode INTEGER, scene_season INTEGER, scene_episode INTEGER, PRIMARY KEY (indexer_id, season, episode))")
|
"CREATE TABLE scene_numbering (indexer TEXT, indexer_id INTEGER, season INTEGER, episode INTEGER, scene_season INTEGER, scene_episode INTEGER, PRIMARY KEY (indexer_id, season, episode))")
|
||||||
|
|
||||||
|
self.incDBVersion()
|
||||||
|
|
||||||
|
|
||||||
|
class ConvertIndexerToInteger(AddSceneNumbering):
|
||||||
|
def test(self):
|
||||||
|
return self.checkDBVersion() >= 28
|
||||||
|
|
||||||
|
def execute(self):
|
||||||
|
backupDatabase(28)
|
||||||
|
|
||||||
|
ql = []
|
||||||
|
logger.log(u"Converting Indexer to Integer ...", logger.MESSAGE)
|
||||||
|
ql.append(["UPDATE tv_shows SET indexer = ? WHERE LOWER(indexer) = ?", ["1", "tvdb"]])
|
||||||
|
ql.append(["UPDATE tv_shows SET indexer = ? WHERE LOWER(indexer) = ?", ["2", "tvrage"]])
|
||||||
|
ql.append(["UPDATE tv_episodes SET indexer = ? WHERE LOWER(indexer) = ?", ["1", "tvdb"]])
|
||||||
|
ql.append(["UPDATE tv_episodes SET indexer = ? WHERE LOWER(indexer) = ?", ["2", "tvrage"]])
|
||||||
|
self.connection.mass_action(ql)
|
||||||
|
|
||||||
self.incDBVersion()
|
self.incDBVersion()
|
Loading…
Reference in New Issue
Block a user