Fix #1104: invalid metadata when importing multi-artists tracks/albums
This commit is contained in:
parent
b5a9bd902f
commit
0c05ac6512
9 changed files with 99 additions and 39 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -17,6 +17,7 @@ DATA_DIR = os.path.dirname(os.path.abspath(__file__))
|
|||
("title", "Peer Gynt Suite no. 1, op. 46: I. Morning"),
|
||||
("artist", "Edvard Grieg"),
|
||||
("album_artist", "Edvard Grieg; Musopen Symphony Orchestra"),
|
||||
("artists", "Edvard Grieg; Musopen Symphony Orchestra"),
|
||||
("album", "Peer Gynt Suite no. 1, op. 46"),
|
||||
("date", "2012-08-15"),
|
||||
("position", "1"),
|
||||
|
|
@ -48,6 +49,7 @@ def test_can_get_metadata_all():
|
|||
"title": "Peer Gynt Suite no. 1, op. 46: I. Morning",
|
||||
"artist": "Edvard Grieg",
|
||||
"album_artist": "Edvard Grieg; Musopen Symphony Orchestra",
|
||||
"artists": "Edvard Grieg; Musopen Symphony Orchestra",
|
||||
"album": "Peer Gynt Suite no. 1, op. 46",
|
||||
"date": "2012-08-15",
|
||||
"position": "1",
|
||||
|
|
@ -70,6 +72,7 @@ def test_can_get_metadata_all():
|
|||
("title", "Peer Gynt Suite no. 1, op. 46: I. Morning"),
|
||||
("artist", "Edvard Grieg"),
|
||||
("album_artist", "Edvard Grieg; Musopen Symphony Orchestra"),
|
||||
("artists", "Edvard Grieg; Musopen Symphony Orchestra"),
|
||||
("album", "Peer Gynt Suite no. 1, op. 46"),
|
||||
("date", "2012-08-15"),
|
||||
("position", "1"),
|
||||
|
|
@ -126,6 +129,7 @@ def test_can_get_metadata_from_ogg_theora_file(field, value):
|
|||
("title", "Bend"),
|
||||
("artist", "Binärpilot"),
|
||||
("album_artist", "Binärpilot"),
|
||||
("artists", "Binärpilot; Another artist"),
|
||||
("album", "You Can't Stop Da Funk"),
|
||||
("date", "2006-02-07"),
|
||||
("position", "2/4"),
|
||||
|
|
@ -202,6 +206,7 @@ def test_can_get_metadata_from_flac_file(field, value):
|
|||
("title", "Peer Gynt Suite no. 1, op. 46: I. Morning"),
|
||||
("artist", "Edvard Grieg"),
|
||||
("album_artist", "Edvard Grieg; Musopen Symphony Orchestra"),
|
||||
("artists", "Edvard Grieg; Musopen Symphony Orchestra"),
|
||||
("album", "Peer Gynt Suite no. 1, op. 46"),
|
||||
("date", "2012-08-15"),
|
||||
("position", 1),
|
||||
|
|
@ -283,7 +288,8 @@ def test_metadata_fallback_ogg_theora(mocker):
|
|||
{
|
||||
"name": "Binärpilot",
|
||||
"mbid": uuid.UUID("9c6bddde-6228-4d9f-ad0d-03f6fcb19e13"),
|
||||
}
|
||||
},
|
||||
{"name": "Another artist", "mbid": None},
|
||||
],
|
||||
"album": {
|
||||
"title": "You Can't Stop Da Funk",
|
||||
|
|
@ -293,7 +299,8 @@ def test_metadata_fallback_ogg_theora(mocker):
|
|||
{
|
||||
"name": "Binärpilot",
|
||||
"mbid": uuid.UUID("9c6bddde-6228-4d9f-ad0d-03f6fcb19e13"),
|
||||
}
|
||||
},
|
||||
{"name": "Another artist", "mbid": None},
|
||||
],
|
||||
},
|
||||
"position": 2,
|
||||
|
|
@ -313,7 +320,8 @@ def test_metadata_fallback_ogg_theora(mocker):
|
|||
{
|
||||
"name": "Edvard Grieg",
|
||||
"mbid": uuid.UUID("013c8e5b-d72a-4cd3-8dee-6c64d6125823"),
|
||||
}
|
||||
},
|
||||
{"name": "Musopen Symphony Orchestra", "mbid": None},
|
||||
],
|
||||
"album": {
|
||||
"title": "Peer Gynt Suite no. 1, op. 46",
|
||||
|
|
@ -347,7 +355,8 @@ def test_metadata_fallback_ogg_theora(mocker):
|
|||
{
|
||||
"name": "Edvard Grieg",
|
||||
"mbid": uuid.UUID("013c8e5b-d72a-4cd3-8dee-6c64d6125823"),
|
||||
}
|
||||
},
|
||||
{"name": "Musopen Symphony Orchestra", "mbid": None},
|
||||
],
|
||||
"album": {
|
||||
"title": "Peer Gynt Suite no. 1, op. 46",
|
||||
|
|
|
|||
|
|
@ -143,6 +143,20 @@ def test_can_create_track_from_file_metadata_description(factories):
|
|||
assert track.description.content_type == "text/plain"
|
||||
|
||||
|
||||
def test_can_create_track_from_file_metadata_use_featuring(factories):
|
||||
metadata = {
|
||||
"title": "Whole Lotta Love",
|
||||
"position": 1,
|
||||
"disc_number": 1,
|
||||
"description": {"text": "hello there", "content_type": "text/plain"},
|
||||
"album": {"title": "Test album"},
|
||||
"artists": [{"name": "Santana"}, {"name": "Anatnas"}],
|
||||
}
|
||||
track = tasks.get_track_from_import_metadata(metadata)
|
||||
|
||||
assert track.artist.name == "Anatnas"
|
||||
|
||||
|
||||
def test_can_create_track_from_file_metadata_mbid(factories, mocker):
|
||||
metadata = {
|
||||
"title": "Test track",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue