Fixed some issues and added some stuff
This commit is contained in:
parent
8fe15ffdb4
commit
2045349163
|
@ -496,6 +496,10 @@ def downloadTrackObj(dz, trackAPI, settings, bitrate, queueItem, extraTrack=None
|
|||
track['album']['picPath'] = os.path.join(TEMPDIR, f"alb{track['album']['id']}_{settings['embeddedArtworkSize']}.{'png' if settings['PNGcovers'] else 'jpg'}")
|
||||
track['album']['picPath'] = downloadImage(track['album']['picUrl'], track['album']['picPath'])
|
||||
|
||||
if os.path.sep in filename:
|
||||
tempPath = filename[:filename.rfind(os.path.sep)]
|
||||
filepath = os.path.join(filepath, tempPath)
|
||||
filename = filename[filename.rfind(os.path.sep)+len(os.path.sep):]
|
||||
makedirs(filepath, exist_ok=True)
|
||||
writepath = os.path.join(filepath, filename + extensions[track['selectedFormat']])
|
||||
|
||||
|
@ -607,9 +611,9 @@ def download(dz, queueItem, socket=None):
|
|||
result = {'error': {
|
||||
'message': str(e),
|
||||
'data': {
|
||||
'id': track['SNG_ID'],
|
||||
'title': track['SNG_TITLE'] + (" "+track['VERSION'] if 'VERSION' in track and track['VERSION'] else ""),
|
||||
'mainArtist': {'name': track['ART_NAME']}
|
||||
'id': queueItem['single']['SNG_ID'],
|
||||
'title': queueItem['single']['SNG_TITLE'] + (" "+queueItem['single']['VERSION'] if 'VERSION' in queueItem['single'] and queueItem['single']['VERSION'] else ""),
|
||||
'mainArtist': {'name': queueItem['single']['ART_NAME']}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import deemix.utils.localpaths as localpaths
|
||||
from deemix.app.queuemanager import addToQueue, removeFromQueue, getQueue, cancelAllDownloads
|
||||
from deemix.app.settings import initSettings
|
||||
from deemix.app.settings import initSettings, getSettings, saveSettings
|
||||
from os import system as execute
|
||||
import os.path as path
|
||||
from os import mkdir, rmdir
|
||||
|
@ -13,7 +13,6 @@ def getUser(dz):
|
|||
def initialize():
|
||||
global settings
|
||||
settings = initSettings()
|
||||
return {'settings': settings}
|
||||
|
||||
def shutdown(socket=None):
|
||||
print(getQueue())
|
||||
|
@ -33,6 +32,18 @@ def addToQueue_link(dz, url, bitrate=None, socket=None):
|
|||
def removeFromQueue_link(uuid, socket=None):
|
||||
removeFromQueue(uuid, socket)
|
||||
|
||||
def getSettings_link():
|
||||
return getSettings()
|
||||
|
||||
def getSettings_link():
|
||||
return getSettings()
|
||||
|
||||
def getQueue_link():
|
||||
return getQueue()
|
||||
|
||||
def saveSettings_link(newSettings):
|
||||
return saveSettings(newSettings)
|
||||
|
||||
def downloadLink(url, bitrate=None):
|
||||
if settings['executeCommand'] != "":
|
||||
execute(settings['executeCommand'].replace("%folder%", folder))
|
||||
|
|
Loading…
Reference in New Issue