mirror of
https://github.com/beetbox/beets.git
synced 2026-07-16 14:07:40 -04:00
discogs: remove redundant check for required fields
This commit is contained in:
@@ -345,20 +345,6 @@ class DiscogsPlugin(SearchApiMetadataSourcePlugin[IDResponse]):
|
||||
)
|
||||
return None
|
||||
|
||||
# Sanity check for required fields. The list of required fields is
|
||||
# defined at Guideline 1.3.1.a, but in practice some releases might be
|
||||
# lacking some of these fields. This function expects at least:
|
||||
# `artists` (>0), `title`, `id`, `tracklist` (>0)
|
||||
# https://www.discogs.com/help/doc/submission-guidelines-general-rules
|
||||
if not all(
|
||||
[
|
||||
result.data.get(k)
|
||||
for k in ["artists", "title", "id", "tracklist"]
|
||||
]
|
||||
):
|
||||
self._log.warning("Release does not contain the required fields")
|
||||
return None
|
||||
|
||||
artist_data = [a.data for a in result.artists]
|
||||
# Information for the album artist
|
||||
albumartist = ArtistState.from_config(
|
||||
|
||||
@@ -329,17 +329,6 @@ class TestDGAlbumInfo(TestHelper):
|
||||
assert d.album == "TITLE"
|
||||
assert len(d.tracks) == 1
|
||||
|
||||
def test_parse_release_without_required_fields(self, caplog):
|
||||
"""Test parsing of a release that does not have the required fields."""
|
||||
release = Bag(data={}, refresh=lambda *args: None)
|
||||
with caplog.at_level("DEBUG"):
|
||||
d = DiscogsPlugin().get_album_info(release)
|
||||
|
||||
assert d is None
|
||||
assert (
|
||||
"Release does not contain the required fields" in caplog.messages[0]
|
||||
)
|
||||
|
||||
def test_default_genre_style_settings(self):
|
||||
"""Test genre default settings, genres to genre, styles to style"""
|
||||
release = self._make_release_from_positions(["1", "2"])
|
||||
|
||||
Reference in New Issue
Block a user