From 04c5cc5d522fae71fc08ed331b62595ba09428b8 Mon Sep 17 00:00:00 2001 From: rembo10 Date: Thu, 2 Aug 2012 15:59:47 +0530 Subject: [PATCH] Modified the correctMetadata function in postProcessor.py to work with the updated beets lib: candidates/out_tuples now returns extra_items & extra_tracks, and input to autotag.apply_metadata was reversed --- headphones/postprocessor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/headphones/postprocessor.py b/headphones/postprocessor.py index 6f275716..3e4125bf 100644 --- a/headphones/postprocessor.py +++ b/headphones/postprocessor.py @@ -470,7 +470,7 @@ def correctMetadata(albumid, release, downloaded_track_list): logger.error("Beets couldn't create an Item from: " + downloaded_track + " - not a media file?" + str(e)) try: - cur_artist, cur_album, out_tuples, rec = autotag.tag_album(items, search_artist=helpers.latinToAscii(release['ArtistName']), search_album=helpers.latinToAscii(release['AlbumTitle'])) + cur_artist, cur_album, candidates, rec = autotag.tag_album(items, search_artist=helpers.latinToAscii(release['ArtistName']), search_album=helpers.latinToAscii(release['AlbumTitle'])) except Exception, e: logger.error('Error getting recommendation: %s. Not writing metadata' % e) return @@ -478,9 +478,9 @@ def correctMetadata(albumid, release, downloaded_track_list): logger.warn('No accurate album match found for %s, %s - not writing metadata' % (release['ArtistName'], release['AlbumTitle'])) return - distance, items, info = out_tuples[0] + dist, info, mapping, extra_items, extra_tracks = candidates[0] logger.debug('Beets recommendation: %s' % rec) - autotag.apply_metadata(items, info) + autotag.apply_metadata(info, mapping) if len(items) != len(downloaded_track_list): logger.warn("Mismatch between number of tracks downloaded and the metadata items, but I'll try to write it anyway")