mirror of
https://github.com/beetbox/beets.git
synced 2026-01-30 20:13:37 +01:00
Enable import of incomplete albums
This commit disables the autoreject for incomplete albums. There is several one-liner fixes in autotag/__init__.py and importer.py, as well as some UI additions to report to the user when a track seems missing.
This commit is contained in:
parent
bb964a7c47
commit
9a7a551d92
4 changed files with 13 additions and 4 deletions
|
|
@ -74,6 +74,8 @@ def apply_metadata(items, album_info):
|
|||
"""
|
||||
for index, (item, track_info) in enumerate(zip(items, album_info.tracks)):
|
||||
# Album, artist, track count.
|
||||
if not item:
|
||||
continue
|
||||
if track_info.artist:
|
||||
item.artist = track_info.artist
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -365,7 +365,7 @@ def validate_candidate(items, tuple_dict, info):
|
|||
return
|
||||
|
||||
# Make sure the album has the correct number of tracks.
|
||||
if len(items) != len(info.tracks):
|
||||
if len(items) > len(info.tracks):
|
||||
log.debug('Track count mismatch.')
|
||||
return
|
||||
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ def _duplicate_check(lib, task, recent=None):
|
|||
recent.add((artist, album))
|
||||
|
||||
# Look in the library.
|
||||
cur_paths = set(i.path for i in task.items)
|
||||
cur_paths = set(i.path for i in task.items if i)
|
||||
for album_cand in lib.albums(artist=artist):
|
||||
if album_cand.album == album:
|
||||
# Check whether the album is identical in contents, in which
|
||||
|
|
@ -591,7 +591,7 @@ def apply_choices(config):
|
|||
if task.should_skip():
|
||||
continue
|
||||
|
||||
items = task.items if task.is_album else [task.item]
|
||||
items = [i for i in task.items if i] if task.is_album else [task.item]
|
||||
# Clear IDs in case the items are being re-tagged.
|
||||
for item in items:
|
||||
item.id = None
|
||||
|
|
@ -644,7 +644,7 @@ def apply_choices(config):
|
|||
# Add new ones.
|
||||
if task.is_album:
|
||||
# Add an album.
|
||||
album = lib.add_album(task.items)
|
||||
album = lib.add_album([i for i in task.items if i])
|
||||
task.album_id = album.id
|
||||
else:
|
||||
# Add tracks.
|
||||
|
|
|
|||
|
|
@ -154,7 +154,11 @@ def show_change(cur_artist, cur_album, items, info, dist, color=True):
|
|||
print_('(Similarity: %s)' % dist_string(dist, color))
|
||||
|
||||
# Tracks.
|
||||
missing_tracks = []
|
||||
for i, (item, track_info) in enumerate(zip(items, info.tracks)):
|
||||
if not item:
|
||||
missing_tracks.append((i, track_info))
|
||||
continue
|
||||
cur_track = unicode(item.track)
|
||||
new_track = unicode(i+1)
|
||||
cur_title = item.title
|
||||
|
|
@ -179,6 +183,9 @@ def show_change(cur_artist, cur_album, items, info, dist, color=True):
|
|||
print_(u" * %s -> %s" % (cur_title, new_title))
|
||||
elif cur_track != new_track:
|
||||
print_(u" * %s (%s -> %s)" % (item.title, cur_track, new_track))
|
||||
for i, track_info in missing_tracks:
|
||||
print_(ui.colorize('red', u' * Missing track: %s (%d)' % \
|
||||
(track_info.title, i+1)))
|
||||
|
||||
def show_item_change(item, info, dist, color):
|
||||
"""Print out the change that would occur by tagging `item` with the
|
||||
|
|
|
|||
Loading…
Reference in a new issue