diff --git a/app.py b/app.py index 5e9ec2a..d32e2c2 100644 --- a/app.py +++ b/app.py @@ -25,6 +25,7 @@ class deemix: self.qm = QueueManager() self.chartsList = [] + self.homeCache = None def shutdown(self, interface=None): if self.set.settings['saveDownloadQueue']: @@ -54,6 +55,11 @@ class deemix: self.chartsList = countries return self.chartsList + def get_home(self, dz): + if not self.homeCache: + self.homeCache = session['dz'].get_charts() + return self.homeCache + def getDownloadFolder(self): return self.set.settings['downloadLocation'] diff --git a/server.py b/server.py index 0c976b9..3863ed9 100644 --- a/server.py +++ b/server.py @@ -119,7 +119,7 @@ def on_connect(): @socketio.on('get_home_data') def get_home_data(): - emit('init_home', session['dz'].get_charts()) + emit('init_home', app.get_home(session['dz'])) @socketio.on('get_charts_data') def get_charts_data():