Verified Commit 66a9a623 authored by Agate's avatar Agate 💬

Fix #1037: More resilient tag parsing with empty release date or album artist

parent 4845a9f9
Pipeline #9864 failed with stages
in 3 minutes and 7 seconds
......@@ -648,7 +648,7 @@ class MBIDField(serializers.UUIDField):
class ArtistSerializer(serializers.Serializer):
name = serializers.CharField(required=False, allow_null=True)
name = serializers.CharField(required=False, allow_null=True, allow_blank=True)
mbid = MBIDField()
def __init__(self, *args, **kwargs):
......@@ -664,7 +664,9 @@ class ArtistSerializer(serializers.Serializer):
class AlbumSerializer(serializers.Serializer):
title = serializers.CharField(required=False, allow_null=True)
mbid = MBIDField()
release_date = PermissiveDateField(required=False, allow_null=True)
release_date = PermissiveDateField(
required=False, allow_null=True, allow_blank=True
)
def validate_title(self, v):
if self.context.get("strict", True) and not v:
......
......@@ -247,6 +247,7 @@ def test_can_get_metadata_from_flac_file_not_crash_if_empty():
("2017-14-01 01:32", datetime.date(2017, 1, 14)), # deezer format
("2017-02", datetime.date(2017, 1, 1)), # weird format that exists
("0000", None),
("", None),
("nonsense", None),
],
)
......
More resilient tag parsing with empty release date or album artist (#1037)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment