Added serverside cache for home tab

This commit is contained in:
RemixDev 2020-08-22 22:41:51 +02:00
parent f31f81e1de
commit 2d44132745
2 changed files with 7 additions and 1 deletions

6
app.py
View file

@ -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']

View file

@ -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():