diff --git a/CHANGELOG.md b/CHANGELOG.md index e43adee..51a4ecf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -85,6 +85,8 @@ - `albumtype`: - Improve accuracy of identifying **EP** and **LP** release types from the description. + - Include **remix** albumtype to the release when remixed track count is one less than + the track count. - `catalognum`: - Add support for new formats: **`UVB76-023`**, **`SOP 061-1233`**, **`a+w lp029`**, diff --git a/beetsplug/bandcamp/metaguru.py b/beetsplug/bandcamp/metaguru.py index a3f4b80..95cf653 100644 --- a/beetsplug/bandcamp/metaguru.py +++ b/beetsplug/bandcamp/metaguru.py @@ -349,12 +349,14 @@ def albumtypes(self) -> List[str]: albumtypes.add("lp") if self.is_single_album: albumtypes.add("single") - if self.albumtype == "single" and len(self.tracks) > 1: + + track_count = len(self.tracks) + if self.albumtype == "single" and track_count > 1: albumtypes.add("album") for word in ["remix", "rmx", "edits", "live", "soundtrack"]: if word in self.original_album.lower(): albumtypes.add(word.replace("rmx", "remix").replace("edits", "remix")) - if len(self.tracks.remixers) == len(self.tracks): + if len(self.tracks.remixers) >= max(track_count - 1, 1): albumtypes.add("remix") return sorted(albumtypes) diff --git a/tests/json/expected/ep.json b/tests/json/expected/ep.json index 6702c22..839ce50 100644 --- a/tests/json/expected/ep.json +++ b/tests/json/expected/ep.json @@ -6,7 +6,8 @@ "albumstatus": "Official", "albumtype": "album", "albumtypes": [ - "album" + "album", + "remix" ], "artist": "DJ DISRESPECT, jeånne", "artist_credit": null, @@ -210,7 +211,8 @@ "albumstatus": "Official", "albumtype": "album", "albumtypes": [ - "album" + "album", + "remix" ], "artist": "DJ DISRESPECT, jeånne", "artist_credit": null, diff --git a/tests/json/expected/remix_without_brackets.json b/tests/json/expected/remix_without_brackets.json index 3e207e5..2e374d3 100644 --- a/tests/json/expected/remix_without_brackets.json +++ b/tests/json/expected/remix_without_brackets.json @@ -7,6 +7,7 @@ "albumtype": "ep", "albumtypes": [ "ep", + "remix", "single" ], "artist": "Aluphobia, Astatine", diff --git a/tests/json/expected/single_with_remixes.json b/tests/json/expected/single_with_remixes.json index fc57bc4..a82162d 100644 --- a/tests/json/expected/single_with_remixes.json +++ b/tests/json/expected/single_with_remixes.json @@ -7,6 +7,7 @@ "albumtype": "single", "albumtypes": [ "album", + "remix", "single" ], "artist": "Reece Cox", @@ -249,6 +250,7 @@ "albumtype": "single", "albumtypes": [ "album", + "remix", "single" ], "artist": "Reece Cox",