mirror of
https://gitlab.com/RemixDev/deemix-gui-pyweb.git
synced 2024-12-29 10:56:06 +00:00
Added serverside cache for home tab
This commit is contained in:
parent
f31f81e1de
commit
2d44132745
6
app.py
6
app.py
|
@ -25,6 +25,7 @@ class deemix:
|
||||||
self.qm = QueueManager()
|
self.qm = QueueManager()
|
||||||
|
|
||||||
self.chartsList = []
|
self.chartsList = []
|
||||||
|
self.homeCache = None
|
||||||
|
|
||||||
def shutdown(self, interface=None):
|
def shutdown(self, interface=None):
|
||||||
if self.set.settings['saveDownloadQueue']:
|
if self.set.settings['saveDownloadQueue']:
|
||||||
|
@ -54,6 +55,11 @@ class deemix:
|
||||||
self.chartsList = countries
|
self.chartsList = countries
|
||||||
return self.chartsList
|
return self.chartsList
|
||||||
|
|
||||||
|
def get_home(self, dz):
|
||||||
|
if not self.homeCache:
|
||||||
|
self.homeCache = session['dz'].get_charts()
|
||||||
|
return self.homeCache
|
||||||
|
|
||||||
def getDownloadFolder(self):
|
def getDownloadFolder(self):
|
||||||
return self.set.settings['downloadLocation']
|
return self.set.settings['downloadLocation']
|
||||||
|
|
||||||
|
|
|
@ -119,7 +119,7 @@ def on_connect():
|
||||||
|
|
||||||
@socketio.on('get_home_data')
|
@socketio.on('get_home_data')
|
||||||
def 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')
|
@socketio.on('get_charts_data')
|
||||||
def get_charts_data():
|
def get_charts_data():
|
||||||
|
|
Loading…
Reference in a new issue