1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-08-13 16:53:54 -04:00

Merge branch 'origin/dev'

This commit is contained in:
echel0n 2014-04-22 10:57:51 -07:00
commit d82e1b1264
2 changed files with 24 additions and 2 deletions

View File

@ -82,6 +82,9 @@ class ConvertSceneExceptionsToIndexerID(AddXemRefresh):
return self.hasColumn("scene_exceptions", "indexer_id") return self.hasColumn("scene_exceptions", "indexer_id")
def execute(self): def execute(self):
if self.hasTable("tmp_scene_exceptions"):
self.connection.action("DROP TABLE tmp_scene_exceptions")
self.connection.action("ALTER TABLE scene_exceptions RENAME TO tmp_scene_exceptions") self.connection.action("ALTER TABLE scene_exceptions RENAME TO tmp_scene_exceptions")
self.connection.action( self.connection.action(
"CREATE TABLE scene_exceptions (exception_id INTEGER PRIMARY KEY, indexer_id INTEGER KEY, show_name TEXT)") "CREATE TABLE scene_exceptions (exception_id INTEGER PRIMARY KEY, indexer_id INTEGER KEY, show_name TEXT)")
@ -95,6 +98,9 @@ class ConvertSceneNamesToIndexerID(ConvertSceneExceptionsToIndexerID):
return self.hasColumn("scene_names", "indexer_id") return self.hasColumn("scene_names", "indexer_id")
def execute(self): def execute(self):
if self.hasTable("tmp_scene_names"):
self.connection.action("DROP TABLE tmp_scene_names")
self.connection.action("ALTER TABLE scene_names RENAME TO tmp_scene_names") self.connection.action("ALTER TABLE scene_names RENAME TO tmp_scene_names")
self.connection.action("CREATE TABLE scene_names (indexer_id INTEGER, name TEXT)") self.connection.action("CREATE TABLE scene_names (indexer_id INTEGER, name TEXT)")
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")

View File

@ -552,8 +552,9 @@ class ConvertTVShowsToIndexerScheme(AddIndicesToTvEpisodes):
logger.log(u"Converting TV Shows table to Indexer Scheme...") logger.log(u"Converting TV Shows table to Indexer Scheme...")
if self.hasTable('tmp_tv_shows'):
logger.log(u"Removing temp tables left behind from previous updates...") if self.hasTable("tmp_tv_shows"):
logger.log(u"Removing temp tv show tables left behind from previous updates...")
self.connection.action("DROP TABLE tmp_tv_shows") self.connection.action("DROP TABLE tmp_tv_shows")
self.connection.action("ALTER TABLE tv_shows RENAME TO tmp_tv_shows") self.connection.action("ALTER TABLE tv_shows RENAME TO tmp_tv_shows")
@ -576,6 +577,11 @@ class ConvertTVEpisodesToIndexerScheme(ConvertTVShowsToIndexerScheme):
backupDatabase(23) backupDatabase(23)
logger.log(u"Converting TV Episodes table to Indexer Scheme...") logger.log(u"Converting TV Episodes table to Indexer Scheme...")
if self.hasTable("tmp_tv_episodes"):
logger.log(u"Removing temp tv episode tables left behind from previous updates...")
self.connection.action("DROP TABLE tmp_tv_episodes")
self.connection.action("ALTER TABLE tv_episodes RENAME TO tmp_tv_episodes") self.connection.action("ALTER TABLE tv_episodes RENAME TO tmp_tv_episodes")
self.connection.action( self.connection.action(
"CREATE TABLE tv_episodes (episode_id INTEGER PRIMARY KEY, showid NUMERIC, indexerid NUMERIC, indexer NUMERIC, name TEXT, season NUMERIC, episode NUMERIC, description TEXT, airdate NUMERIC, hasnfo NUMERIC, hastbn NUMERIC, status NUMERIC, location TEXT, file_size NUMERIC, release_name TEXT, subtitles TEXT, subtitles_searchcount NUMERIC, subtitles_lastsearch TIMESTAMP, is_proper NUMERIC)") "CREATE TABLE tv_episodes (episode_id INTEGER PRIMARY KEY, showid NUMERIC, indexerid NUMERIC, indexer NUMERIC, name TEXT, season NUMERIC, episode NUMERIC, description TEXT, airdate NUMERIC, hasnfo NUMERIC, hastbn NUMERIC, status NUMERIC, location TEXT, file_size NUMERIC, release_name TEXT, subtitles TEXT, subtitles_searchcount NUMERIC, subtitles_lastsearch TIMESTAMP, is_proper NUMERIC)")
@ -595,6 +601,11 @@ class ConvertIMDBInfoToIndexerScheme(ConvertTVEpisodesToIndexerScheme):
backupDatabase(24) backupDatabase(24)
logger.log(u"Converting IMDB Info table to Indexer Scheme...") logger.log(u"Converting IMDB Info table to Indexer Scheme...")
if self.hasTable("tmp_imdb_info"):
logger.log(u"Removing temp imdb info tables left behind from previous updates...")
self.connection.action("DROP TABLE tmp_imdb_info")
self.connection.action("ALTER TABLE imdb_info RENAME TO tmp_imdb_info") self.connection.action("ALTER TABLE imdb_info RENAME TO tmp_imdb_info")
self.connection.action( self.connection.action(
"CREATE TABLE imdb_info (indexer_id INTEGER PRIMARY KEY, imdb_id TEXT, title TEXT, year NUMERIC, akas TEXT, runtimes NUMERIC, genres TEXT, countries TEXT, country_codes TEXT, certificates TEXT, rating TEXT, votes INTEGER, last_update NUMERIC)") "CREATE TABLE imdb_info (indexer_id INTEGER PRIMARY KEY, imdb_id TEXT, title TEXT, year NUMERIC, akas TEXT, runtimes NUMERIC, genres TEXT, countries TEXT, country_codes TEXT, certificates TEXT, rating TEXT, votes INTEGER, last_update NUMERIC)")
@ -613,6 +624,11 @@ class ConvertInfoToIndexerScheme(ConvertIMDBInfoToIndexerScheme):
backupDatabase(25) backupDatabase(25)
logger.log(u"Converting Info table to Indexer Scheme...") logger.log(u"Converting Info table to Indexer Scheme...")
if self.hasTable("tmp_info"):
logger.log(u"Removing temp info tables left behind from previous updates...")
self.connection.action("DROP TABLE tmp_info")
self.connection.action("ALTER TABLE info RENAME TO tmp_info") self.connection.action("ALTER TABLE info RENAME TO tmp_info")
self.connection.action( self.connection.action(
"CREATE TABLE info (last_backlog NUMERIC, last_indexer NUMERIC, last_proper_search NUMERIC)") "CREATE TABLE info (last_backlog NUMERIC, last_indexer NUMERIC, last_proper_search NUMERIC)")