reverted change from selectedFormat to errorNum in downloadTrackObj
This commit is contained in:
parent
9cfb5bbd43
commit
4d4132286b
|
@ -485,7 +485,7 @@ def downloadTrackObj(dz, trackAPI, settings, bitrate, queueItem, extraTrack=None
|
||||||
interface.send("updateQueue", {'uuid': queueItem['uuid'], 'failed': True, 'data': track,
|
interface.send("updateQueue", {'uuid': queueItem['uuid'], 'failed': True, 'data': track,
|
||||||
'error': "Track is not available in Reality Audio 360."})
|
'error': "Track is not available in Reality Audio 360."})
|
||||||
return result
|
return result
|
||||||
track['errorNum'] = format
|
track['selectedFormat'] = format
|
||||||
track['dateString'] = formatDate(track['date'], settings['dateFormat'])
|
track['dateString'] = formatDate(track['date'], settings['dateFormat'])
|
||||||
if settings['tags']['savePlaylistAsCompilation'] and "_EXTRA_PLAYLIST" in trackAPI:
|
if settings['tags']['savePlaylistAsCompilation'] and "_EXTRA_PLAYLIST" in trackAPI:
|
||||||
if 'dzcdn.net' in trackAPI["_EXTRA_PLAYLIST"]['picture_small']:
|
if 'dzcdn.net' in trackAPI["_EXTRA_PLAYLIST"]['picture_small']:
|
||||||
|
@ -579,7 +579,7 @@ def downloadTrackObj(dz, trackAPI, settings, bitrate, queueItem, extraTrack=None
|
||||||
filepath = os.path.join(filepath, tempPath)
|
filepath = os.path.join(filepath, tempPath)
|
||||||
filename = filename[filename.rfind(os.path.sep) + len(os.path.sep):]
|
filename = filename[filename.rfind(os.path.sep) + len(os.path.sep):]
|
||||||
makedirs(filepath, exist_ok=True)
|
makedirs(filepath, exist_ok=True)
|
||||||
writepath = os.path.join(filepath, filename + extensions[track['errorNum']])
|
writepath = os.path.join(filepath, filename + extensions[track['selectedFormat']])
|
||||||
|
|
||||||
# Save lyrics in lrc file
|
# Save lyrics in lrc file
|
||||||
if settings['syncedLyrics'] and 'sync' in track['lyrics']:
|
if settings['syncedLyrics'] and 'sync' in track['lyrics']:
|
||||||
|
@ -608,7 +608,7 @@ def downloadTrackObj(dz, trackAPI, settings, bitrate, queueItem, extraTrack=None
|
||||||
result['playlistPosition'] = writepath[len(extrasPath):]
|
result['playlistPosition'] = writepath[len(extrasPath):]
|
||||||
|
|
||||||
track['downloadUrl'] = dz.get_track_stream_url(track['id'], track['MD5'], track['mediaVersion'],
|
track['downloadUrl'] = dz.get_track_stream_url(track['id'], track['MD5'], track['mediaVersion'],
|
||||||
track['errorNum'])
|
track['selectedFormat'])
|
||||||
logger.info(f"[{track['mainArtist']['name']} - {track['title']}] Downloading the track")
|
logger.info(f"[{track['mainArtist']['name']} - {track['title']}] Downloading the track")
|
||||||
try:
|
try:
|
||||||
with open(writepath, 'wb') as stream:
|
with open(writepath, 'wb') as stream:
|
||||||
|
@ -661,9 +661,9 @@ def downloadTrackObj(dz, trackAPI, settings, bitrate, queueItem, extraTrack=None
|
||||||
'error': "Track not available on deezer's servers!"})
|
'error': "Track not available on deezer's servers!"})
|
||||||
return result
|
return result
|
||||||
logger.info(f"[{track['mainArtist']['name']} - {track['title']}] Applying tags to the track")
|
logger.info(f"[{track['mainArtist']['name']} - {track['title']}] Applying tags to the track")
|
||||||
if track['errorNum'] in [3, 1, 8]:
|
if track['selectedFormat'] in [3, 1, 8]:
|
||||||
tagID3(writepath, track, settings['tags'])
|
tagID3(writepath, track, settings['tags'])
|
||||||
elif track['errorNum'] == 9:
|
elif track['selectedFormat'] == 9:
|
||||||
tagFLAC(writepath, track, settings['tags'])
|
tagFLAC(writepath, track, settings['tags'])
|
||||||
if 'searched' in track:
|
if 'searched' in track:
|
||||||
result['searched'] = f'{track["mainArtist"]["name"]} - {track["title"]}'
|
result['searched'] = f'{track["mainArtist"]["name"]} - {track["title"]}'
|
||||||
|
|
Loading…
Reference in New Issue