Correctly display track number 0 in show_change

fixes issue #3346: When the per_disc_numbering option was set, the UI would
previously show a #0 -> #1 change when actually the index would be set
to 0 (a valid index, such as for hidden tracks).  Now, properly
distinguish index 0 and None (i.e. not set)
This commit is contained in:
wisp3rwind 2019-08-19 23:23:00 +02:00
parent 27e0e7600d
commit 0bc3727fcf

View file

@ -241,7 +241,8 @@ def show_change(cur_artist, cur_album, match):
if mediums and mediums > 1:
return u'{0}-{1}'.format(medium, medium_index)
else:
return six.text_type(medium_index or index)
return six.text_type(medium_index if medium_index is not None
else index)
else:
return six.text_type(index)