mirror of
https://github.com/beetbox/beets.git
synced 2026-01-04 06:53:27 +01:00
Trace hierarchy of index tracks
This commit is contained in:
parent
6889b9ffdc
commit
e31695b606
1 changed files with 9 additions and 0 deletions
|
|
@ -398,14 +398,23 @@ class DiscogsPlugin(BeetsPlugin):
|
|||
tracks = []
|
||||
index_tracks = {}
|
||||
index = 0
|
||||
divisions, next_divisions = [], []
|
||||
for track in clean_tracklist:
|
||||
# Only real tracks have `position`. Otherwise, it's an index track.
|
||||
if track['position']:
|
||||
index += 1
|
||||
if next_divisions:
|
||||
divisions += next_divisions
|
||||
next_divisions.clear()
|
||||
track_info = self.get_track_info(track, index)
|
||||
track_info.track_alt = track['position']
|
||||
tracks.append(track_info)
|
||||
else:
|
||||
next_divisions.append(track['title'])
|
||||
try:
|
||||
divisions.pop()
|
||||
except IndexError:
|
||||
pass
|
||||
index_tracks[index + 1] = track['title']
|
||||
|
||||
# Fix up medium and medium_index for each track. Discogs position is
|
||||
|
|
|
|||
Loading…
Reference in a new issue