diff --git a/picard/mbjson.py b/picard/mbjson.py index b362bb164..38e891f1d 100644 --- a/picard/mbjson.py +++ b/picard/mbjson.py @@ -150,7 +150,7 @@ def _relations_to_metadata(relations, m): if not has_translation and use_credited_as and 'target-credit' in relation: credited_as = relation['target-credit'] if credited_as: - value, valuesort = credited_as, credited_as + value = credited_as reltype = relation['type'] attribs = [] if 'attributes' in relation: diff --git a/test/data/ws_data/recording_composer.json b/test/data/ws_data/recording_composer.json new file mode 100644 index 000000000..f65050563 --- /dev/null +++ b/test/data/ws_data/recording_composer.json @@ -0,0 +1,1147 @@ +{ + "video": false, + "relations": [ + { + "type-id": "234670ce-5f22-4fd0-921b-ef1662695c5d", + "artist": { + "type-id": "b6e035f4-3ce9-331c-97df-83397230b0df", + "sort-name": "Dutoit, Charles", + "id": "64a7dc4d-79b0-4033-9b9a-6c64671de8b7", + "name": "Charles Dutoit", + "type": "Person", + "disambiguation": "conductor" + }, + "begin": "1991-05-29", + "source-credit": "", + "target-credit": "", + "end": "1991-05-31", + "direction": "backward", + "attribute-ids": {}, + "type": "conductor", + "attribute-values": {}, + "ended": true, + "target-type": "artist", + "attributes": [] + }, + { + "target-credit": "", + "direction": "backward", + "end": "1991-05-31", + "attribute-ids": {}, + "type": "engineer", + "attribute-values": {}, + "ended": true, + "attributes": [], + "target-type": "artist", + "type-id": "5dcc52af-7064-4051-8d62-7d80f4c3c907", + "artist": { + "sort-name": "Moorfoot, Colin", + "type-id": "b6e035f4-3ce9-331c-97df-83397230b0df", + "id": "0c815fd4-77a3-48e2-ad4e-78a0db46b491", + "name": "Colin Moorfoot", + "disambiguation": "engineer", + "type": "Person" + }, + "begin": "1991-05-29", + "source-credit": "" + }, + { + "attribute-ids": {}, + "direction": "backward", + "end": "1991-05-31", + "target-credit": "", + "attributes": [], + "target-type": "artist", + "ended": true, + "attribute-values": {}, + "type": "performing orchestra", + "artist": { + "name": "Orchestre symphonique de Montréal", + "id": "52f351cf-e724-4225-82d6-dcb77333ace4", + "disambiguation": "", + "type": "Orchestra", + "sort-name": "Orchestre symphonique de Montréal", + "type-id": "a0b36c92-3eb1-3839-a4f9-4799823f54a5" + }, + "type-id": "3b6616c5-88ba-4341-b4ee-81ce1e6d7ebb", + "source-credit": "", + "begin": "1991-05-29" + }, + { + "type": "producer", + "attribute-values": {}, + "ended": false, + "attributes": [], + "target-type": "artist", + "target-credit": "", + "direction": "backward", + "end": null, + "attribute-ids": {}, + "begin": null, + "source-credit": "", + "type-id": "5c0ceac3-feb4-41f0-868d-dc06f6e27fc0", + "artist": { + "type-id": "b6e035f4-3ce9-331c-97df-83397230b0df", + "sort-name": "Minshull, Ray", + "id": "b05e5740-0b2f-4353-8ecc-a6101b9763cb", + "name": "Ray Minshull", + "disambiguation": "record producer", + "type": "Person" + } + }, + { + "target-credit": "", + "attribute-ids": {}, + "work": { + "iswcs": [], + "disambiguation": "", + "title": "Swan Lake, op. 20: Act II, no. 13: Danses des cygnes: III. Danses des Cygnes: Tempo di valse", + "language": null, + "type-id": null, + "id": "c8aebb07-fb03-36d3-ade4-3a2692810615", + "type": null, + "attributes": [], + "languages": [], + "relations": [ + { + "artist": { + "sort-name": "Tchaikovsky, Pyotr Ilyich", + "type-id": "b6e035f4-3ce9-331c-97df-83397230b0df", + "id": "9ddd7abc-9e1b-471d-8031-583bc6bc8be9", + "name": "Пётр Ильич Чайковский", + "type": "Person", + "disambiguation": "Tchaikovsky - Russian romantic composer" + }, + "type-id": "d59d99ea-23d4-4a80-b066-edca32ee158f", + "source-credit": "", + "begin": null, + "attribute-ids": {}, + "direction": "backward", + "end": null, + "target-credit": "Tchaikovsky", + "target-type": "artist", + "attributes": [], + "ended": false, + "attribute-values": {}, + "type": "composer" + }, + { + "begin": null, + "source-credit": "", + "target-credit": "", + "attribute-ids": {}, + "ordering-key": 3, + "work": { + "id": "3481d89d-95f0-4f74-afe6-02b33a9095ac", + "type": null, + "attributes": [], + "languages": [], + "iswcs": [], + "disambiguation": "", + "title": "Swan Lake, op. 20: Act II, no. 13: Danses des cygnes", + "language": null, + "type-id": null + }, + "type": "parts", + "attributes": [], + "type-id": "ca8d3642-ce5f-49f8-91f2-125d72524e6a", + "direction": "backward", + "end": null, + "attribute-values": {}, + "ended": false, + "target-type": "work" + } + ] + }, + "type": "performance", + "attributes": [], + "begin": "1991-05-29", + "source-credit": "", + "end": "1991-05-31", + "direction": "forward", + "attribute-values": {}, + "ended": true, + "target-type": "work", + "type-id": "a3005666-a872-32c3-ad06-98af558e99b0" + } + ], + "id": "22bac38a-53c2-4eb3-bbd0-76144c390154", + "first-release-date": "1992-11-26", + "aliases": [], + "length": 91000, + "title": "Act 2: IVc. Dance des Cygnes - Dance des Cygnes", + "disambiguation": "", + "artist-credit": [ + { + "artist": { + "type": "Person", + "id": "9ddd7abc-9e1b-471d-8031-583bc6bc8be9", + "name": "Пётр Ильич Чайковский", + "aliases": [ + { + "end": null, + "locale": null, + "name": "Chaikovsky", + "type": "Search hint", + "ended": false, + "primary": null, + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "sort-name": "Chaikovsky", + "begin": null + }, + { + "begin": null, + "sort-name": "Ciaikosvsky", + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "ended": false, + "primary": null, + "type": "Search hint", + "name": "Ciaikosvsky", + "locale": null, + "end": null + }, + { + "type": "Search hint", + "name": "Ciaikovsky", + "ended": false, + "primary": null, + "end": null, + "locale": null, + "begin": null, + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "sort-name": "Ciaikovsky" + }, + { + "name": "Hich", + "type": "Search hint", + "ended": false, + "primary": null, + "end": null, + "locale": null, + "begin": null, + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "sort-name": "Hich" + }, + { + "end": null, + "locale": null, + "type": "Search hint", + "name": "II'yich", + "primary": null, + "ended": false, + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "sort-name": "II'yich", + "begin": null + }, + { + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "sort-name": "Il'yich", + "begin": null, + "end": null, + "locale": null, + "type": "Search hint", + "name": "Il'yich", + "primary": null, + "ended": false + }, + { + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "sort-name": "Ilic", + "begin": null, + "end": null, + "locale": null, + "type": "Search hint", + "name": "Ilic", + "primary": null, + "ended": false + }, + { + "end": null, + "locale": null, + "type": "Search hint", + "name": "Ilich", + "primary": null, + "ended": false, + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "sort-name": "Ilich", + "begin": null + }, + { + "begin": null, + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "sort-name": "Ilitsch", + "name": "Ilitsch", + "type": "Search hint", + "primary": null, + "ended": false, + "end": null, + "locale": null + }, + { + "end": null, + "locale": null, + "type": "Search hint", + "name": "Iljitsch", + "primary": null, + "ended": false, + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "sort-name": "Iljitsch", + "begin": null + }, + { + "end": null, + "locale": null, + "name": "Illich", + "type": "Search hint", + "primary": null, + "ended": false, + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "sort-name": "Illich", + "begin": null + }, + { + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "sort-name": "Illitch", + "begin": null, + "end": null, + "locale": null, + "type": "Search hint", + "name": "Illitch", + "primary": null, + "ended": false + }, + { + "begin": null, + "sort-name": "Illyich", + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "ended": false, + "primary": null, + "type": "Search hint", + "name": "Illyich", + "locale": null, + "end": null + }, + { + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "sort-name": "Ilych", + "begin": null, + "end": null, + "locale": null, + "type": "Search hint", + "name": "Ilych", + "primary": null, + "ended": false + }, + { + "locale": null, + "end": null, + "primary": null, + "ended": false, + "name": "Ilyitch", + "type": "Search hint", + "sort-name": "Ilyitch", + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "begin": null + }, + { + "end": null, + "locale": null, + "name": "Llyich", + "type": "Search hint", + "primary": null, + "ended": false, + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "sort-name": "Llyich", + "begin": null + }, + { + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "sort-name": "P. Čaikovskis", + "begin": null, + "end": null, + "locale": null, + "type": "Search hint", + "name": "P. Čaikovskis", + "primary": null, + "ended": false + }, + { + "begin": null, + "sort-name": "Tschaikowsky, Peter I.", + "type-id": null, + "primary": null, + "ended": false, + "name": "Peter I. Tschaikowsky", + "type": null, + "locale": null, + "end": null + }, + { + "end": null, + "locale": null, + "name": "Peter Ilich Tchaikovsky", + "type": null, + "ended": false, + "primary": null, + "type-id": null, + "sort-name": "Tchaikovsky, Peter Ilich", + "begin": null + }, + { + "end": null, + "locale": null, + "type": null, + "name": "Peter Iljitsch Tschaikowsky", + "primary": null, + "ended": false, + "type-id": null, + "sort-name": "Tschaikowsky, Peter Iljitsch", + "begin": null + }, + { + "ended": false, + "primary": false, + "type": "Artist name", + "name": "Peter Ilyich Tchaikovsky", + "locale": "en", + "end": null, + "begin": null, + "sort-name": "Tchaikovsky, Peter Ilyich", + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc" + }, + { + "locale": "en", + "end": null, + "ended": false, + "primary": false, + "type": "Artist name", + "name": "Peter Tchaikovsky", + "sort-name": "Tchaikovsky, Peter", + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc", + "begin": null + }, + { + "locale": null, + "end": null, + "primary": null, + "ended": false, + "name": "Peter Tschaikowsky", + "type": "Artist name", + "sort-name": "Tschaikowsky, Peter", + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc", + "begin": null + }, + { + "sort-name": "Czajkowski, Piotr", + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc", + "begin": null, + "locale": "pl", + "end": null, + "ended": false, + "primary": true, + "type": "Artist name", + "name": "Piotr Czajkowski" + }, + { + "name": "Piotr Ilitch Tchaïkovski", + "type": "Legal name", + "primary": true, + "ended": false, + "end": null, + "locale": "fr", + "begin": null, + "type-id": "d4dcd0c0-b341-3612-a332-c0ce797b25cf", + "sort-name": "Tchaïkovski, Piotr Ilitch" + }, + { + "locale": "fr", + "end": null, + "primary": false, + "ended": false, + "name": "Piotr Ilitch Tchaïkovski", + "type": "Artist name", + "sort-name": "Tchaïkovski, Piotr Ilitch", + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc", + "begin": null + }, + { + "primary": true, + "ended": false, + "type": "Artist name", + "name": "Piotr Iljič Čajkovskij", + "locale": "sk", + "end": null, + "begin": null, + "sort-name": "Piotr Iljič Čajkovskij", + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc" + }, + { + "sort-name": "Tchaikovski, Piotr Ilyich", + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc", + "begin": null, + "locale": "pt_PT", + "end": null, + "ended": false, + "primary": true, + "type": "Artist name", + "name": "Piotr Ilyich Tchaikovski" + }, + { + "ended": false, + "primary": true, + "name": "Pjotr Iljitj Tjajkovskij", + "type": "Artist name", + "locale": "da", + "end": null, + "begin": null, + "sort-name": "Tjajkovskij, Pjotr Iljitj", + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc" + }, + { + "sort-name": "Tschaikowski, Pjotr Iljitsch", + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc", + "begin": null, + "locale": "de", + "end": null, + "primary": true, + "ended": false, + "type": "Artist name", + "name": "Pjotr Iljitsch Tschaikowski" + }, + { + "begin": null, + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc", + "sort-name": "Tsjaikovski, Pjotr Iljitsj", + "name": "Pjotr Iljitsj Tsjaikovski", + "type": "Artist name", + "ended": false, + "primary": true, + "end": null, + "locale": "nl" + }, + { + "ended": false, + "primary": true, + "type": "Artist name", + "name": "Pjotr Iljitsj Tsjaíkovskíj", + "locale": "is", + "end": null, + "begin": null, + "sort-name": "Tsjaíkovskíj, Pjotr Iljitsj", + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc" + }, + { + "begin": null, + "sort-name": "Tjajkovskij, Pjotr", + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc", + "primary": true, + "ended": false, + "name": "Pjotr Tjajkovskij", + "type": "Artist name", + "locale": "sv", + "end": null + }, + { + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc", + "sort-name": "Tsjaikofski, Pjotr", + "begin": null, + "end": null, + "locale": "af", + "name": "Pjotr Tsjaikofski", + "type": "Artist name", + "ended": false, + "primary": true + }, + { + "begin": null, + "sort-name": "Pjotr Tsjajkovskij", + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc", + "ended": false, + "primary": true, + "type": "Artist name", + "name": "Pjotr Tsjajkovskij", + "locale": "nb", + "end": null + }, + { + "begin": null, + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc", + "sort-name": "Tsjajkovskij, Pjotr", + "name": "Pjotr Tsjajkovskij", + "type": "Artist name", + "ended": false, + "primary": true, + "end": null, + "locale": "nn" + }, + { + "sort-name": "Tšaikovski, Pjotr", + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc", + "begin": null, + "locale": "et", + "end": null, + "primary": true, + "ended": false, + "type": "Artist name", + "name": "Pjotr Tšaikovski" + }, + { + "locale": "fi", + "end": null, + "primary": true, + "ended": false, + "name": "Pjotr Tšaikovski", + "type": "Artist name", + "sort-name": "Tšaikovski, Pjotr", + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc", + "begin": null + }, + { + "end": null, + "locale": "lv", + "type": "Artist name", + "name": "Pjotrs Čaikovskis", + "primary": false, + "ended": false, + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc", + "sort-name": "Čaikovskis, Pjotrs", + "begin": null + }, + { + "locale": null, + "end": null, + "ended": false, + "primary": null, + "name": "Pyotor", + "type": "Search hint", + "sort-name": "Pyotor", + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "begin": null + }, + { + "begin": null, + "type-id": null, + "sort-name": "Pyotr Il'yich Tchaikovsky", + "type": null, + "name": "Pyotr Il'yich Tchaikovsky", + "ended": false, + "primary": null, + "end": null, + "locale": null + }, + { + "name": "Pyotr Ilyich Tchaikovsky", + "type": "Artist name", + "primary": true, + "ended": false, + "end": null, + "locale": "en", + "begin": null, + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc", + "sort-name": "Tchaikovsky, Pyotr Ilyich" + }, + { + "sort-name": "Tchaikovsky, Pyotr", + "type-id": null, + "begin": null, + "locale": null, + "end": null, + "ended": false, + "primary": null, + "name": "Pyotr Tchaikovsky", + "type": null + }, + { + "end": null, + "locale": "tr", + "name": "Pyotr İlyiç Çaykovski", + "type": "Artist name", + "ended": false, + "primary": true, + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc", + "sort-name": "Pyotr İlyiç Çaykovski", + "begin": null + }, + { + "primary": true, + "ended": false, + "type": "Artist name", + "name": "Pëtr Il'ič Čajkovskij", + "locale": "it", + "end": null, + "begin": null, + "sort-name": "Čajkovskij, Pëtr Il'ič", + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc" + }, + { + "name": "Pēteris Čaikovskis", + "type": "Artist name", + "ended": false, + "primary": true, + "end": null, + "locale": "lv", + "begin": null, + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc", + "sort-name": "Čaikovskis, Pēteris" + }, + { + "sort-name": "Tchaikivsky", + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "begin": null, + "locale": null, + "end": null, + "ended": false, + "primary": null, + "name": "Tchaikivsky", + "type": "Search hint" + }, + { + "begin": null, + "sort-name": "Tchaikoskvy", + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "primary": null, + "ended": false, + "name": "Tchaikoskvy", + "type": "Search hint", + "locale": null, + "end": null + }, + { + "locale": null, + "end": null, + "ended": false, + "primary": null, + "type": "Search hint", + "name": "Tchaikovisky", + "sort-name": "Tchaikovisky", + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "begin": null + }, + { + "begin": null, + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "sort-name": "Tchaikovshy", + "name": "Tchaikovshy", + "type": "Search hint", + "ended": false, + "primary": null, + "end": null, + "locale": null + }, + { + "begin": null, + "sort-name": "Tchaikovski", + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "primary": null, + "ended": false, + "name": "Tchaikovski", + "type": "Search hint", + "locale": null, + "end": null + }, + { + "locale": null, + "end": null, + "ended": false, + "primary": null, + "name": "Tchaikovskij", + "type": "Search hint", + "sort-name": "Tchaikovskij", + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "begin": null + }, + { + "begin": null, + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "sort-name": "Tchaikovsky", + "name": "Tchaikovsky", + "type": "Search hint", + "ended": false, + "primary": null, + "end": null, + "locale": null + }, + { + "end": null, + "locale": null, + "type": "Search hint", + "name": "Tchaikovskyes", + "ended": false, + "primary": null, + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "sort-name": "Tchaikovskyes", + "begin": null + }, + { + "sort-name": "Tchaikovskys", + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "begin": null, + "locale": null, + "end": null, + "ended": false, + "primary": null, + "name": "Tchaikovskys", + "type": "Search hint" + }, + { + "sort-name": "Tchaikovsly", + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "begin": null, + "locale": null, + "end": null, + "primary": null, + "ended": false, + "name": "Tchaikovsly", + "type": "Search hint" + }, + { + "begin": null, + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "sort-name": "Tchaikovsy", + "name": "Tchaikovsy", + "type": "Search hint", + "ended": false, + "primary": null, + "end": null, + "locale": null + }, + { + "sort-name": "Tchaikowski", + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "begin": null, + "locale": null, + "end": null, + "ended": false, + "primary": null, + "name": "Tchaikowski", + "type": "Search hint" + }, + { + "ended": false, + "primary": null, + "type": "Search hint", + "name": "Tchaikowsky", + "locale": null, + "end": null, + "begin": null, + "sort-name": "Tchaikowsky", + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e" + }, + { + "name": "Tchailovisky", + "type": "Search hint", + "ended": false, + "primary": null, + "end": null, + "locale": null, + "begin": null, + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "sort-name": "Tchailovisky" + }, + { + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "sort-name": "Tchakovsky", + "begin": null, + "end": null, + "locale": null, + "name": "Tchakovsky", + "type": "Search hint", + "primary": null, + "ended": false + }, + { + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "sort-name": "Tchaïkovki", + "begin": null, + "end": null, + "locale": null, + "name": "Tchaïkovki", + "type": "Search hint", + "ended": false, + "primary": null + }, + { + "sort-name": "Tchaïkovsky", + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "begin": null, + "locale": null, + "end": null, + "primary": null, + "ended": false, + "type": "Search hint", + "name": "Tchaïkovsky" + }, + { + "type": "Search hint", + "name": "Tchiakovsky", + "ended": false, + "primary": null, + "end": null, + "locale": null, + "begin": null, + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "sort-name": "Tchiakovsky" + }, + { + "locale": null, + "end": null, + "ended": false, + "primary": null, + "type": "Search hint", + "name": "Tchikovsky", + "sort-name": "Tchikovsky", + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "begin": null + }, + { + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "sort-name": "Tjakovski", + "begin": null, + "end": null, + "locale": null, + "type": "Search hint", + "name": "Tjakovski", + "ended": false, + "primary": null + }, + { + "primary": null, + "ended": false, + "type": "Search hint", + "name": "Tjakovsky", + "locale": null, + "end": null, + "begin": null, + "sort-name": "Tjakovsky", + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e" + }, + { + "sort-name": "Tschaikovsky", + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "begin": null, + "locale": null, + "end": null, + "primary": null, + "ended": false, + "type": "Search hint", + "name": "Tschaikovsky" + }, + { + "begin": null, + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "sort-name": "Tschaikowski", + "name": "Tschaikowski", + "type": "Search hint", + "ended": false, + "primary": null, + "end": null, + "locale": null + }, + { + "locale": null, + "end": null, + "primary": null, + "ended": false, + "name": "Tschaikowskij", + "type": "Search hint", + "sort-name": "Tschaikowskij", + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "begin": null + }, + { + "sort-name": "Tschaikowsky", + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "begin": null, + "locale": null, + "end": null, + "primary": null, + "ended": false, + "type": "Search hint", + "name": "Tschaikowsky" + }, + { + "begin": null, + "sort-name": "Tsjaikovski", + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "primary": null, + "ended": false, + "type": "Search hint", + "name": "Tsjaikovski", + "locale": null, + "end": null + }, + { + "begin": null, + "sort-name": "Tsjaikovsky", + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "ended": false, + "primary": null, + "type": "Search hint", + "name": "Tsjaikovsky", + "locale": null, + "end": null + }, + { + "end": null, + "locale": null, + "name": "Tsjajkovskij", + "type": "Search hint", + "primary": null, + "ended": false, + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "sort-name": "Tsjajkovskij", + "begin": null + }, + { + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e", + "sort-name": "Txhaikovsky", + "begin": null, + "end": null, + "locale": null, + "type": "Search hint", + "name": "Txhaikovsky", + "primary": null, + "ended": false + }, + { + "primary": null, + "ended": false, + "name": "Èajkovskij", + "type": "Search hint", + "locale": null, + "end": null, + "begin": null, + "sort-name": "Èajkovskij", + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e" + }, + { + "primary": null, + "ended": false, + "name": "Čajkovski", + "type": "Search hint", + "locale": null, + "end": null, + "begin": null, + "sort-name": "Čajkovski", + "type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e" + }, + { + "type": "Artist name", + "name": "Петр Ильич Чайковский", + "ended": false, + "primary": false, + "end": null, + "locale": "ru", + "begin": null, + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc", + "sort-name": "Чайковский, Петр Ильич" + }, + { + "primary": true, + "ended": false, + "name": "Петро Ілліч Чайковський", + "type": "Artist name", + "locale": "uk", + "end": null, + "begin": null, + "sort-name": "Чайковський, Петро Ілліч", + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc" + }, + { + "type-id": "d4dcd0c0-b341-3612-a332-c0ce797b25cf", + "sort-name": "Чайковский, Пётр Ильич", + "begin": null, + "end": null, + "locale": "ru", + "type": "Legal name", + "name": "Пётр Ильич Чайковский", + "ended": false, + "primary": false + }, + { + "begin": null, + "sort-name": "Чайковский, Пётр", + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc", + "primary": true, + "ended": false, + "name": "Пётр Чайковский", + "type": "Artist name", + "locale": "ru", + "end": null + }, + { + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc", + "sort-name": "بيتر إليتش تشايكوفسكي", + "begin": null, + "end": null, + "locale": "ar", + "type": "Artist name", + "name": "بيتر إليتش تشايكوفسكي", + "ended": false, + "primary": true + }, + { + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc", + "sort-name": "チャイコフスキー", + "begin": null, + "end": null, + "locale": "ja", + "type": "Artist name", + "name": "チャイコフスキー", + "ended": false, + "primary": true + }, + { + "name": "ピョートル・チャイコフスキー", + "type": "Artist name", + "primary": false, + "ended": false, + "end": null, + "locale": "ja", + "begin": null, + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc", + "sort-name": "チャイコフスキー ピョートル" + }, + { + "end": null, + "locale": "zh", + "type": "Artist name", + "name": "彼得·伊里奇·柴可夫斯基", + "ended": false, + "primary": true, + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc", + "sort-name": "彼得·伊里奇·柴可夫斯基", + "begin": null + }, + { + "type": "Artist name", + "name": "彼得·伊里奇·柴科夫斯基", + "ended": false, + "primary": false, + "end": null, + "locale": "zh", + "begin": null, + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc", + "sort-name": "彼得·伊里奇·柴科夫斯基" + }, + { + "type": "Artist name", + "name": "표트르 일리치 차이콥스키", + "primary": true, + "ended": false, + "end": null, + "locale": "ko", + "begin": null, + "type-id": "894afba6-2816-3c24-8072-eadb66bd04bc", + "sort-name": "차이콥스키, 표트르 일리치" + } + ], + "disambiguation": "Tchaikovsky - Russian romantic composer", + "type-id": "b6e035f4-3ce9-331c-97df-83397230b0df", + "sort-name": "Tchaikovsky, Pyotr Ilyich" + }, + "name": "Pyotr Ilyich Tchaikovsky", + "joinphrase": "" + } + ] +} \ No newline at end of file diff --git a/test/test_mbjson.py b/test/test_mbjson.py index 5f16afda4..32728a5b2 100644 --- a/test/test_mbjson.py +++ b/test/test_mbjson.py @@ -216,6 +216,37 @@ class RecordingTest(MBJSONTest): self.assertEqual(m['performer:acoustic guitar'], 'Ed Sheeran') +class RecordingComposerCreditsTest(MBJSONTest): + + filename = 'recording_composer.json' + + def test_standardize_artists(self): + m = Metadata() + t = Track('1') + config.setting['translate_artist_names'] = False + config.setting['standardize_artists'] = True + recording_to_metadata(self.json_doc, m, t) + self.assertEqual(m['composer'], 'Пётр Ильич Чайковский') + self.assertEqual(m['composersort'], 'Tchaikovsky, Pyotr Ilyich') + + def test_use_credited_as(self): + m = Metadata() + t = Track('1') + config.setting['translate_artist_names'] = False + config.setting['standardize_artists'] = False + recording_to_metadata(self.json_doc, m, t) + self.assertEqual(m['composer'], 'Tchaikovsky') + self.assertEqual(m['composersort'], 'Tchaikovsky, Pyotr Ilyich') + + def test_translate(self): + m = Metadata() + t = Track('1') + config.setting['translate_artist_names'] = True + recording_to_metadata(self.json_doc, m, t) + self.assertEqual(m['composer'], 'Pyotr Ilyich Tchaikovsky') + self.assertEqual(m['composersort'], 'Tchaikovsky, Pyotr Ilyich') + + class RecordingInstrumentalTest(MBJSONTest): filename = 'recording_instrumental.json'