From de08059da48f4e89fe47d9b7fffc44479581f056 Mon Sep 17 00:00:00 2001 From: Thomas Scholtes Date: Wed, 21 May 2014 11:58:18 +0200 Subject: [PATCH] Fix replaced items in importer Previously, `task.replaced_items[item]` was a `Result` instance. This meant that iterating over these, in the plugin stage for example, would fetch them from the database. But by then the items had been replaced with the imported versions. Now we instantiate the list of replaced items so that we always get the same, old ones. --- beets/importer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beets/importer.py b/beets/importer.py index 344e382dd..a1248acbb 100644 --- a/beets/importer.py +++ b/beets/importer.py @@ -549,7 +549,7 @@ class ImportTask(object): self.replaced_items = defaultdict(list) for item in self.imported_items(): dup_items = lib.items(dbcore.query.BytesQuery('path', item.path)) - self.replaced_items[item] = dup_items + self.replaced_items[item] = list(dup_items) for dup_item in dup_items: log.debug('replacing item %i: %s' % (dup_item.id, displayable_path(item.path)))