Merge branch 'title_version_missing_fix' into 'main'

fixed exception while mapping track if title version is missing

See merge request RemixDev/deezer-py!3
This commit is contained in:
RemixDev 2022-01-04 20:05:59 +00:00
commit 3dcc1fbb56

View file

@ -359,7 +359,7 @@ def map_track(track):
'track_token_expire': track['TRACK_TOKEN_EXPIRE']
}
if int(track['SNG_ID']) > 0:
result['title_version'] = track.get('VERSION').strip()
result['title_version'] = track.get('VERSION', "").strip()
if result['title_version'] != "" and result['title_version'] in result['title_short']:
result['title_short'] = result['title_short'].replace(result['title_version'], "").strip()
result['title'] = f"{result['title_short']} {result['title_version']}".strip()