Commit 23a06aaf authored by echel0n's avatar echel0n
Browse files

Removed SceneException table and SceneExceptionRefresh table from Cache database.

parent 104163bd
......@@ -76,14 +76,6 @@ class CacheDB(SRDatabase):
provider = Column(String(32), primary_key=True)
time = Column(Integer)
class SceneException(CacheDBBase):
__tablename__ = 'scene_exceptions'
id = Column(Integer, primary_key=True)
indexer_id = Column(Integer)
show_name = Column(Text)
season = Column(Integer)
class SceneName(CacheDBBase):
__tablename__ = 'scene_names'
......@@ -97,12 +89,6 @@ class CacheDB(SRDatabase):
network_name = Column(String(256), primary_key=True)
timezone = Column(Text)
class SceneExceptionRefresh(CacheDBBase):
__tablename__ = 'scene_exceptions_refresh'
exception_list = Column(String(32), primary_key=True)
last_refreshed = Column(Integer)
class Provider(CacheDBBase):
__tablename__ = 'providers'
......
......@@ -989,23 +989,19 @@ class CMD_Exceptions(ApiCall):
async def run(self):
""" Get the scene exceptions for all or a given show """
session = sickrage.app.cache_db.session()
if self.indexerid is None:
scene_exceptions = {}
for dbData in session.query(CacheDB.SceneException):
indexer_id = dbData.indexer_id
for show in get_show_list():
indexer_id = show.indexer_id
if indexer_id not in scene_exceptions:
scene_exceptions[indexer_id] = []
scene_exceptions[indexer_id].append(dbData.show_name)
scene_exceptions[indexer_id].append(show.name)
else:
showObj = find_show(int(self.indexerid))
if not showObj:
show = find_show(int(self.indexerid))
if not show:
return await _responds(RESULT_FAILURE, msg="Show not found")
scene_exceptions = []
for dbData in session.query(CacheDB.SceneException).filter_by(indexer_id=self.indexerid):
scene_exceptions.append(dbData.show_name)
scene_exceptions = show.scene_exceptions
return await _responds(RESULT_SUCCESS, scene_exceptions)
......
Supports Markdown
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