From cd18d7aca42887ca1c0d5acf28761598c1b0a224 Mon Sep 17 00:00:00 2001 From: mdecker Date: Sun, 3 Apr 2011 18:43:41 +0200 Subject: [PATCH 1/2] fix double deletion problem of source files when import_delete is set --- beets/ui/commands.py | 1 - 1 file changed, 1 deletion(-) diff --git a/beets/ui/commands.py b/beets/ui/commands.py index 062a204c1..565c8c3f5 100644 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -532,7 +532,6 @@ def apply_choices(lib, copy, write, art, delete, progress): # Only delete files that were actually moved. if old_path not in new_paths: os.remove(library._syspath(old_path)) - os.remove(library._syspath(old_path)) # Update progress. if progress: From c96335b3538798542130b5d6d6d5b85891236b95 Mon Sep 17 00:00:00 2001 From: mdecker Date: Sun, 3 Apr 2011 20:36:53 +0200 Subject: [PATCH 2/2] skip track artist distance check for compilations when artist info not available the musicbrainz DB does not contain artist names for compilations, example: release ID 762fb051-f435-4c67-895c-6e859f4cdc05 --- beets/autotag/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/beets/autotag/__init__.py b/beets/autotag/__init__.py index 7b20da3b4..b3cf6975a 100644 --- a/beets/autotag/__init__.py +++ b/beets/autotag/__init__.py @@ -301,7 +301,9 @@ def track_distance(item, track_data, track_index=None, incl_artist=False): dist_max += TRACK_TITLE_WEIGHT # Track artist, if included. - if incl_artist: + # Attention: MB DB does not have artist info for all compilations, + # so only check artist distance if there is actually an artist in the MB track data + if incl_artist and 'artist' in track_data: dist += string_dist(item.artist, track_data['artist']) * \ TRACK_ARTIST_WEIGHT dist_max += TRACK_ARTIST_WEIGHT