Commit 07148331 authored by echel0n's avatar echel0n

Refactored core loading shows function to use query object from database to fill show details.

parent c8883865
......@@ -563,15 +563,14 @@ class Core(object):
self.loading_shows = True
self.shows = {}
for show in session.query(MainDB.TVShow).with_entities(MainDB.TVShow.indexer_id, MainDB.TVShow.indexer,
for query in session.query(MainDB.TVShow).with_entities(MainDB.TVShow.indexer_id, MainDB.TVShow.indexer,
try:'Loading show {} and building caches'.format(
show = TVShow(show.indexer_id, show.indexer)
self.shows.update({(show.indexer_id, show.indexer): show})
self.quicksearch_cache.add_show(show.indexer_id)'Loading show {} and building caches'.format(
self.shows.update({(query.indexer_id, query.indexer): TVShow(query.indexer_id, query.indexer)})[(query.indexer_id, query.indexer)])
except Exception as e:
self.log.debug('There was an error loading show: {}'.format(
self.log.debug('There was an error loading show: {}'.format(
self.loading_shows = False
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