From 41310d7d172284e453c2b9debe342aa955eb0e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0ar=C5=ABnas=20Nejus?= Date: Mon, 18 Jan 2021 03:39:39 +0000 Subject: [PATCH] Ignore merch listings --- CHANGELOG.md | 8 ++++++++ README.md | 3 ++- beetsplug/bandcamp/_metaguru.py | 5 ++++- pyproject.toml | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89565b2f..d93d1297 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# [0.5.2] 2021-01-18 + +### Fixed +- On Bandcamp merch is listed in the same list together with media - this is now + taken into account and merch is ignored. Previously, some albums would fail to + be returned because of this. + + # [0.5.1] 2021-01-18 ### Fixed diff --git a/README.md b/README.md index 157f6ad1..1b8c839a 100644 --- a/README.md +++ b/README.md @@ -98,4 +98,5 @@ release is found when importing you can select `enter Id` and paste the Bandcamp * \* are likely to be inaccurate, since Bandcamp does not provide this data, therefore they depend on artists providing some clues in the descriptions of - their releases. + their releases. This is only relevant if you have `per_disc_numbering` set to + `True` in the global beets configuration. diff --git a/beetsplug/bandcamp/_metaguru.py b/beetsplug/bandcamp/_metaguru.py index 1df51c06..c2ee0db2 100644 --- a/beetsplug/bandcamp/_metaguru.py +++ b/beetsplug/bandcamp/_metaguru.py @@ -361,7 +361,10 @@ def album(self, include_all: bool) -> AlbumInfo: medias: JSONDict = {} try: for _format in self.meta["albumRelease"]: - media = _format["musicReleaseFormat"] + try: + media = _format["musicReleaseFormat"] + except KeyError: + continue medias[MEDIA_MAP[media]] = _format except (KeyError, AttributeError): return None diff --git a/pyproject.toml b/pyproject.toml index 88aecfc9..1cf1c308 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "beetcamp" -version = "0.5.1" +version = "0.5.2" description = "Bandcamp autotagger source for beets (http://beets.io)." authors = ["Šarūnas Nejus "] readme = "README.md"