From 8ad22749eae9f66e2f682f0c5ab7b8a417e30fcd Mon Sep 17 00:00:00 2001 From: multikatt Date: Wed, 10 Jun 2015 11:09:56 -0400 Subject: [PATCH] Unset item.id to avoid double add items to albums This hugely improves publishing times --- beetsplug/ipfs.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/beetsplug/ipfs.py b/beetsplug/ipfs.py index df766eac5..aa0aff05f 100644 --- a/beetsplug/ipfs.py +++ b/beetsplug/ipfs.py @@ -262,9 +262,10 @@ class IPFSPlugin(BeetsPlugin): item.path = '/ipfs/{0}/{1}'.format(album.ipfs, os.path.basename(item.path)) - tmplib.add(item) - item.store() + item.id = None items.append(item) + if len(items) < 1: + return False self._log.info("Adding '{0}' to temporary library", album) new_album = tmplib.add_album(items) new_album.ipfs = album.ipfs