mirror of
https://gitlab.com/RemixDev/deemix-gui-pyweb.git
synced 2025-01-15 11:05:16 +00:00
Started implementing Link Analyzer's tab
This commit is contained in:
parent
904692f8dd
commit
8fcf858a2b
9
app.py
9
app.py
|
@ -1,4 +1,5 @@
|
|||
from deemix.app.queuemanager import addToQueue, removeFromQueue, getQueue, cancelAllDownloads, removeFinishedDownloads
|
||||
from deemix.utils.misc import getTypeFromLink, getIDFromLink
|
||||
from deemix.app.settings import initSettings, getSettings, saveSettings
|
||||
from deemix.app.spotify import SpotifyHelper
|
||||
|
||||
|
@ -53,6 +54,14 @@ def removeFinishedDownloads_link(interface=None):
|
|||
def getQueue_link():
|
||||
return getQueue()
|
||||
|
||||
def analyzeLink(dz, link):
|
||||
type = getTypeFromLink(link)
|
||||
relID = getIDFromLink(link, type)
|
||||
if type in ["track", "album"]:
|
||||
data = getattr(dz, 'get_' + type)(relID)
|
||||
else:
|
||||
data = {}
|
||||
return (type, data)
|
||||
|
||||
# Settings functions
|
||||
def getSettings_link():
|
||||
|
|
|
@ -169,6 +169,10 @@ def getTracklist(data):
|
|||
releaseAPI['tracks'] = tracks
|
||||
emit('show_' + data['type'], releaseAPI)
|
||||
|
||||
@socketio.on('analyzeLink')
|
||||
def analyzeLink(link):
|
||||
(type, data) = app.analyzeLink(session['dz'], link)
|
||||
emit('analyze_'+type, data)
|
||||
|
||||
def run_server(port):
|
||||
print("Starting server at http://127.0.0.1:" + str(port))
|
||||
|
|
Loading…
Reference in a new issue