Commit 40720328 authored by Agate's avatar Agate 💬

Merge branch '1037-empty-date' into 'develop'

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

Closes #1037

See merge request !1050
parents 4845a9f9 73958459
Pipeline #9882 passed with stages
in 8 minutes and 43 seconds
......@@ -135,9 +135,8 @@ test_api:
only:
- branches
before_script:
- apk add make
- apk add make git
- cd api
- sed -i '/Pillow/d' requirements/base.txt
- pip3 install -r requirements/base.txt
- pip3 install -r requirements/local.txt
- pip3 install -r requirements/test.txt
......
......@@ -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