Skip to content

Commit eb497ee

Browse files
committed
Only consider release collections in mbcollection plugin
1 parent f461651 commit eb497ee

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

beetsplug/mbcollection.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,14 @@ def _get_collection(self):
7070
if not collections["collection-list"]:
7171
raise ui.UserError("no collections exist for user")
7272

73-
# Get all collection IDs, avoiding event collections
74-
collection_ids = [x["id"] for x in collections["collection-list"]]
73+
# Get all release collection IDs, avoiding event collections
74+
collection_ids = [
75+
x["id"]
76+
for x in collections["collection-list"]
77+
if x["entity-type"] == "release"
78+
]
7579
if not collection_ids:
76-
raise ui.UserError("No collection found.")
80+
raise ui.UserError("No release collection found.")
7781

7882
# Check that the collection exists so we can present a nice error
7983
collection = self.config["collection"].as_str()

docs/changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ New features:
2828
:bug:`5832`
2929
* :doc:`plugins/playlist`: Support files with the `.m3u8` extension.
3030
:bug:`5829`
31+
* :doc:`plugins/mbcollection`: When getting the user collections, only consider
32+
collections of releases, and ignore collections of other entity types.
3133

3234
Bug fixes:
3335

0 commit comments

Comments
 (0)