From d6b6ebbeb96212d5477e6aaf5244e3ec61a836e7 Mon Sep 17 00:00:00 2001 From: David Logie Date: Thu, 22 Feb 2018 18:44:51 +0000 Subject: [PATCH] mbcollection: Make sure missing albums are removed from collections correctly. --- beetsplug/mbcollection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/beetsplug/mbcollection.py b/beetsplug/mbcollection.py index c01d544a4..d99c386c9 100644 --- a/beetsplug/mbcollection.py +++ b/beetsplug/mbcollection.py @@ -103,8 +103,8 @@ class MusicBrainzCollectionPlugin(BeetsPlugin): offset = 0 albums_in_collection, release_count = _fetch(offset) for i in range(0, release_count, FETCH_CHUNK_SIZE): - offset += FETCH_CHUNK_SIZE albums_in_collection += _fetch(offset)[0] + offset += FETCH_CHUNK_SIZE return albums_in_collection @@ -122,7 +122,7 @@ class MusicBrainzCollectionPlugin(BeetsPlugin): def remove_missing(self, collection_id, lib_albums): lib_ids = set([x.mb_albumid for x in lib_albums]) albums_in_collection = self._get_albums_in_collection(collection_id) - remove_me = list(lib_ids - set(albums_in_collection)) + remove_me = list(set(albums_in_collection) - lib_ids) for i in range(0, len(remove_me), FETCH_CHUNK_SIZE): chunk = remove_me[i:i + FETCH_CHUNK_SIZE] mb_call(