Fix applying track index in per_disc_numbering

Fixes #2085. This is the second half, which deals with actually applying the
track number. The previous condition didn't acknowledge that `Item` coerced
`None` to 0 to enforce its field types.
This commit is contained in:
Adrian Sampson 2016-06-28 20:38:41 -07:00
parent f46bfdf219
commit aea692a112
2 changed files with 6 additions and 2 deletions

View file

@ -97,8 +97,9 @@ def apply_metadata(album_info, mapping):
if config['per_disc_numbering']:
# We want to let the track number be zero, but if the medium index
# is not provided we need to fall back to the overall index.
item.track = track_info.medium_index
if item.track is None:
if track_info.medium_index is not None:
item.track = track_info.medium_index
else:
item.track = track_info.index
item.tracktotal = track_info.medium_total or len(album_info.tracks)
else:

View file

@ -23,6 +23,9 @@ Fixes:
* :doc:`/plugins/permissions`: Fix a regression in the previous release where
the plugin would always fail to set permissions (and log a warning).
:bug:`2089`
* With :ref:`per_disc_numbering` enabled, some metadata sources (notably, the
:doc:`/plugins/beatport`) would not set the track number at all. This is
fixed. :bug:`2085`
The last release, 1.3.19, also erroneously reported its version as "1.3.18"
when you typed ``beet version``. This has been corrected.