Fixed tab back function and added disc number

This commit is contained in:
RemixDev 2020-04-18 11:40:19 +02:00
parent 1d031d9e51
commit b48cde6c7d

View file

@ -139,6 +139,16 @@ def getTracklist(data):
else:
releaseAPI = getattr(session['dz'], 'get_'+data['type'])(data['id'])
releaseTracksAPI = getattr(session['dz'], 'get_'+data['type']+'_tracks')(data['id'])['data']
if data['type'] == 'album' and releaseTracksAPI[-1]['disk_number'] != 1:
tracks = []
current_disk = 0
for release in releaseTracksAPI:
if int(release['disk_number']) != current_disk:
current_disk = int(release['disk_number'])
tracks.append({'type': 'disc_separator', 'number': current_disk})
tracks.append(release)
releaseAPI['tracks'] = tracks
else:
releaseAPI['tracks'] = releaseTracksAPI
emit('show_'+data['type'], releaseAPI)