Commit 2ff1e13a authored by echel0n's avatar echel0n

Added check to find_show function, if indexer_id is NoneType then return None.

parent 526e0c17
......@@ -75,8 +75,8 @@ class MainDB(SRDatabase):
last_backlog_search = Column(Integer, default=datetime.datetime.now().toordinal())
last_proper_search = Column(Integer, default=datetime.datetime.now().toordinal())
episodes = relationship('TVEpisode', uselist=True, backref='tv_shows', lazy='joined')
imdb_info = relationship('IMDbInfo', uselist=False, backref='tv_shows', lazy='joined')
episodes = relationship('TVEpisode', uselist=True, backref='tv_shows', lazy='dynamic')
imdb_info = relationship('IMDbInfo', uselist=False, backref='tv_shows')
class TVEpisode(MainDBBase):
__tablename__ = 'tv_episodes'
......@@ -114,7 +114,7 @@ class MainDB(SRDatabase):
version = Column(Integer, default=-1)
release_group = Column(Text, default='')
show = relationship('TVShow', uselist=False, backref='tv_episodes', lazy='joined')
show = relationship('TVShow', uselist=False, backref='tv_episodes')
class IMDbInfo(MainDBBase):
__tablename__ = 'imdb_info'
......
......@@ -23,6 +23,9 @@ import sickrage
def find_show(indexer_id, indexer=1):
if not indexer_id:
return None
return sickrage.app.shows.get((int(indexer_id), int(indexer)), None)
......
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