mirror of
https://github.com/beetbox/beets.git
synced 2026-01-30 12:02:41 +01:00
Add comments
This commit is contained in:
parent
02e03be93d
commit
8805ba28fd
1 changed files with 4 additions and 0 deletions
|
|
@ -398,12 +398,14 @@ class DiscogsPlugin(BeetsPlugin):
|
|||
tracks = []
|
||||
index_tracks = {}
|
||||
index = 0
|
||||
# Distinct works and intra-work divisions, as defined by index tracks.
|
||||
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:
|
||||
# End of a block of index tracks: update the current divisions.
|
||||
divisions += next_divisions
|
||||
next_divisions.clear()
|
||||
track_info = self.get_track_info(track, index, divisions)
|
||||
|
|
@ -411,6 +413,8 @@ class DiscogsPlugin(BeetsPlugin):
|
|||
tracks.append(track_info)
|
||||
else:
|
||||
next_divisions.append(track['title'])
|
||||
# We expect new levels of division at the beginning of the tracklist
|
||||
# (and possibly elsewhere).
|
||||
try:
|
||||
divisions.pop()
|
||||
except IndexError:
|
||||
|
|
|
|||
Loading…
Reference in a new issue