Added 'errid' for translations
This commit is contained in:
parent
fc0d781219
commit
8734e01b0f
|
@ -470,7 +470,7 @@ def downloadTrackObj(dz, trackAPI, settings, bitrate, queueItem, extraTrack=None
|
||||||
queueItem['errors'].append(result['error'])
|
queueItem['errors'].append(result['error'])
|
||||||
if interface:
|
if interface:
|
||||||
interface.send("updateQueue", {'uuid': queueItem['uuid'], 'failed': True, 'data': result['error']['data'],
|
interface.send("updateQueue", {'uuid': queueItem['uuid'], 'failed': True, 'data': result['error']['data'],
|
||||||
'error': "This track is not available on Deezer!"})
|
'error': "This track is not available on Deezer!", 'errid': 'notOnDeezer'})
|
||||||
return result
|
return result
|
||||||
# Get the metadata
|
# Get the metadata
|
||||||
logger.info(f"[{trackAPI['ART_NAME']} - {trackAPI['SNG_TITLE']}] Getting the tags")
|
logger.info(f"[{trackAPI['ART_NAME']} - {trackAPI['SNG_TITLE']}] Getting the tags")
|
||||||
|
@ -517,7 +517,7 @@ def downloadTrackObj(dz, trackAPI, settings, bitrate, queueItem, extraTrack=None
|
||||||
queueItem['errors'].append(result['error'])
|
queueItem['errors'].append(result['error'])
|
||||||
if interface:
|
if interface:
|
||||||
interface.send("updateQueue", {'uuid': queueItem['uuid'], 'failed': True, 'data': result['error']['data'],
|
interface.send("updateQueue", {'uuid': queueItem['uuid'], 'failed': True, 'data': result['error']['data'],
|
||||||
'error': "Track not yet encoded and no alternative found!"})
|
'error': "Track not yet encoded and no alternative found!", 'errid': 'notEncodedNoAlternative'})
|
||||||
return result
|
return result
|
||||||
else:
|
else:
|
||||||
logger.error(f"[{track['mainArtist']['name']} - {track['title']}] Track not yet encoded!")
|
logger.error(f"[{track['mainArtist']['name']} - {track['title']}] Track not yet encoded!")
|
||||||
|
@ -534,7 +534,7 @@ def downloadTrackObj(dz, trackAPI, settings, bitrate, queueItem, extraTrack=None
|
||||||
queueItem['errors'].append(result['error'])
|
queueItem['errors'].append(result['error'])
|
||||||
if interface:
|
if interface:
|
||||||
interface.send("updateQueue", {'uuid': queueItem['uuid'], 'failed': True, 'data': result['error']['data'],
|
interface.send("updateQueue", {'uuid': queueItem['uuid'], 'failed': True, 'data': result['error']['data'],
|
||||||
'error': "Track not yet encoded!"})
|
'error': "Track not yet encoded!", 'errid': 'notEncoded'})
|
||||||
return result
|
return result
|
||||||
|
|
||||||
# Get the selected bitrate
|
# Get the selected bitrate
|
||||||
|
@ -570,7 +570,7 @@ def downloadTrackObj(dz, trackAPI, settings, bitrate, queueItem, extraTrack=None
|
||||||
queueItem['errors'].append(result['error'])
|
queueItem['errors'].append(result['error'])
|
||||||
if interface:
|
if interface:
|
||||||
interface.send("updateQueue", {'uuid': queueItem['uuid'], 'failed': True, 'data': result['error']['data'],
|
interface.send("updateQueue", {'uuid': queueItem['uuid'], 'failed': True, 'data': result['error']['data'],
|
||||||
'error': "Track not found at desired bitrate and no alternative found!"})
|
'error': "Track not found at desired bitrate and no alternative found!", 'errid': 'wrongBitrateNoAlternative'})
|
||||||
return result
|
return result
|
||||||
else:
|
else:
|
||||||
logger.error(f"[{track['mainArtist']['name']} - {track['title']}] Track not found at desired bitrate. Enable fallback to lower bitrates to fix this issue.")
|
logger.error(f"[{track['mainArtist']['name']} - {track['title']}] Track not found at desired bitrate. Enable fallback to lower bitrates to fix this issue.")
|
||||||
|
@ -587,7 +587,7 @@ def downloadTrackObj(dz, trackAPI, settings, bitrate, queueItem, extraTrack=None
|
||||||
queueItem['errors'].append(result['error'])
|
queueItem['errors'].append(result['error'])
|
||||||
if interface:
|
if interface:
|
||||||
interface.send("updateQueue", {'uuid': queueItem['uuid'], 'failed': True, 'data': result['error']['data'],
|
interface.send("updateQueue", {'uuid': queueItem['uuid'], 'failed': True, 'data': result['error']['data'],
|
||||||
'error': "Track not found at desired bitrate."})
|
'error': "Track not found at desired bitrate.", 'errid': 'wrongBitrate'})
|
||||||
return result
|
return result
|
||||||
elif selectedBitrate == -200:
|
elif selectedBitrate == -200:
|
||||||
logger.error(f"[{track['mainArtist']['name']} - {track['title']}] This track is not available in 360 Reality Audio format. Please select another format.")
|
logger.error(f"[{track['mainArtist']['name']} - {track['title']}] This track is not available in 360 Reality Audio format. Please select another format.")
|
||||||
|
@ -604,7 +604,7 @@ def downloadTrackObj(dz, trackAPI, settings, bitrate, queueItem, extraTrack=None
|
||||||
queueItem['errors'].append(result['error'])
|
queueItem['errors'].append(result['error'])
|
||||||
if interface:
|
if interface:
|
||||||
interface.send("updateQueue", {'uuid': queueItem['uuid'], 'failed': True, 'data': result['error']['data'],
|
interface.send("updateQueue", {'uuid': queueItem['uuid'], 'failed': True, 'data': result['error']['data'],
|
||||||
'error': "Track is not available in Reality Audio 360."})
|
'error': "Track is not available in Reality Audio 360.", 'errid': 'no360RA'})
|
||||||
return result
|
return result
|
||||||
track['selectedFormat'] = selectedBitrate
|
track['selectedFormat'] = selectedBitrate
|
||||||
if "_EXTRA_PLAYLIST" in trackAPI:
|
if "_EXTRA_PLAYLIST" in trackAPI:
|
||||||
|
@ -819,7 +819,7 @@ def downloadTrackObj(dz, trackAPI, settings, bitrate, queueItem, extraTrack=None
|
||||||
queueItem['errors'].append(result['error'])
|
queueItem['errors'].append(result['error'])
|
||||||
if interface:
|
if interface:
|
||||||
interface.send("updateQueue", {'uuid': queueItem['uuid'], 'failed': True, 'data': result['error']['data'],
|
interface.send("updateQueue", {'uuid': queueItem['uuid'], 'failed': True, 'data': result['error']['data'],
|
||||||
'error': "Track not available on deezer's servers and no alternative found!"})
|
'error': "Track not available on deezer's servers and no alternative found!", 'errid': 'notAvailableNoAlternative'})
|
||||||
return 1
|
return 1
|
||||||
else:
|
else:
|
||||||
logger.error(f"[{track['mainArtist']['name']} - {track['title']}] Track not available on deezer's servers!")
|
logger.error(f"[{track['mainArtist']['name']} - {track['title']}] Track not available on deezer's servers!")
|
||||||
|
@ -836,7 +836,7 @@ def downloadTrackObj(dz, trackAPI, settings, bitrate, queueItem, extraTrack=None
|
||||||
queueItem['errors'].append(result['error'])
|
queueItem['errors'].append(result['error'])
|
||||||
if interface:
|
if interface:
|
||||||
interface.send("updateQueue", {'uuid': queueItem['uuid'], 'failed': True, 'data': result['error']['data'],
|
interface.send("updateQueue", {'uuid': queueItem['uuid'], 'failed': True, 'data': result['error']['data'],
|
||||||
'error': "Track not available on deezer's servers!"})
|
'error': "Track not available on deezer's servers!", 'errid': 'notAvailable'})
|
||||||
return 1
|
return 1
|
||||||
except:
|
except:
|
||||||
logger.warn(f"[{track['mainArtist']['name']} - {track['title']}] Error while downloading the track, trying again in 5s...")
|
logger.warn(f"[{track['mainArtist']['name']} - {track['title']}] Error while downloading the track, trying again in 5s...")
|
||||||
|
|
Loading…
Reference in New Issue