mirror of
https://gitlab.com/RemixDev/deemix-gui-pyweb.git
synced 2024-12-28 18:36:07 +00:00
Added "open downloads folder" button on GUI
This commit is contained in:
parent
1f342f4ff8
commit
3903874552
4
app.py
4
app.py
|
@ -55,6 +55,10 @@ def loadDownloadQueue(dz, interface=None):
|
||||||
remove(path.join(getConfigFolder(), 'queue.json'))
|
remove(path.join(getConfigFolder(), 'queue.json'))
|
||||||
restoreQueue(qd['queue'], qd['queueComplete'], qd['queueList'], dz, interface)
|
restoreQueue(qd['queue'], qd['queueComplete'], qd['queueList'], dz, interface)
|
||||||
|
|
||||||
|
def getDownloadFolder():
|
||||||
|
global settings
|
||||||
|
return settings['downloadLocation']
|
||||||
|
|
||||||
def get_charts(dz):
|
def get_charts(dz):
|
||||||
global chartsList
|
global chartsList
|
||||||
if len(chartsList) == 0:
|
if len(chartsList) == 0:
|
||||||
|
|
11
server.py
11
server.py
|
@ -1,6 +1,7 @@
|
||||||
#!/usr/env/bin python3
|
#!/usr/env/bin python3
|
||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
|
import subprocess
|
||||||
from os import path
|
from os import path
|
||||||
|
|
||||||
from flask import Flask, render_template, request, session
|
from flask import Flask, render_template, request, session
|
||||||
|
@ -244,6 +245,16 @@ def update_userArtists():
|
||||||
def update_userTracks():
|
def update_userTracks():
|
||||||
emit('updated_userTracks', app.updateUserTracks(session['dz']))
|
emit('updated_userTracks', app.updateUserTracks(session['dz']))
|
||||||
|
|
||||||
|
@socketio.on('openDownloadsFolder')
|
||||||
|
def openDownloadsFolder():
|
||||||
|
folder = app.getDownloadFolder()
|
||||||
|
if sys.platform == 'darwin':
|
||||||
|
subprocess.check_call(['open', folder])
|
||||||
|
elif sys.platform == 'linux':
|
||||||
|
subprocess.check_call(['xdg-open', folder])
|
||||||
|
elif sys.platform == 'win32':
|
||||||
|
subprocess.check_call(['explorer', folder])
|
||||||
|
|
||||||
def run_server(port):
|
def run_server(port):
|
||||||
print("Starting server at http://127.0.0.1:" + str(port))
|
print("Starting server at http://127.0.0.1:" + str(port))
|
||||||
socketio.run(server, host='0.0.0.0', port=port)
|
socketio.run(server, host='0.0.0.0', port=port)
|
||||||
|
|
Loading…
Reference in a new issue