From 9f87870a84f61dfe1c35314a6bf34e707c59c2dd Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sun, 13 Oct 2013 18:26:19 -0700 Subject: [PATCH] per_disc_numbering: fall back to global indices If the per-medium values aren't available, use the global numbers. --- beets/autotag/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/beets/autotag/__init__.py b/beets/autotag/__init__.py index c5fa15b11..3b659b0b6 100644 --- a/beets/autotag/__init__.py +++ b/beets/autotag/__init__.py @@ -197,8 +197,8 @@ def apply_metadata(album_info, mapping): item.title = track_info.title if config['per_disc_numbering']: - item.track = track_info.medium_index - item.tracktotal = track_info.medium_total + item.track = track_info.medium_index or track_info.index + item.tracktotal = track_info.medium_total or len(album_info.tracks) else: item.track = track_info.index item.tracktotal = len(album_info.tracks)