diff --git a/lib/MusicBrainz/Server/WebService/XMLSerializer.pm b/lib/MusicBrainz/Server/WebService/XMLSerializer.pm index da3218fc7bf..a2ee09bd660 100644 --- a/lib/MusicBrainz/Server/WebService/XMLSerializer.pm +++ b/lib/MusicBrainz/Server/WebService/XMLSerializer.pm @@ -115,6 +115,7 @@ sub _serialize_alias_list unless $al->begin_date->is_empty; $alias_node->_setAttribute('end-date', $al->end_date->format) unless $al->end_date->is_empty; + $alias_node->_setAttribute('ended', 'ended') if $al->ended; $alias_node->appendText($al->name); } diff --git a/t/lib/t/MusicBrainz/Server/Controller/WS/2/BrowseArtists.pm b/t/lib/t/MusicBrainz/Server/Controller/WS/2/BrowseArtists.pm index 6306062e6f6..566df6818dc 100644 --- a/t/lib/t/MusicBrainz/Server/Controller/WS/2/BrowseArtists.pm +++ b/t/lib/t/MusicBrainz/Server/Controller/WS/2/BrowseArtists.pm @@ -44,11 +44,11 @@ ws2_test_xml 'browse artists via recording', 1986-11-05 - Beat of Angel - BoA Kwon + Beat of Angel + BoA Kwon Kwon BoA - ボア - 보아 + ボア + 보아 diff --git a/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/BrowseArtists.pm b/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/BrowseArtists.pm index c67f20d28b7..01a026dc038 100644 --- a/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/BrowseArtists.pm +++ b/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/BrowseArtists.pm @@ -101,11 +101,11 @@ test 'browse artists via recording' => sub { type => 'Person', 'type-id' => 'b6e035f4-3ce9-331c-97df-83397230b0df', aliases => [ - { name => 'Beat of Angel', 'sort-name' => 'Beat of Angel', locale => JSON::null, primary => JSON::null, type => JSON::null, 'type-id' => JSON::null, begin => JSON::null, end => JSON::null, ended => JSON::false }, - { name => 'BoA Kwon', 'sort-name' => 'BoA Kwon', locale => JSON::null, primary => JSON::null, type => JSON::null, 'type-id' => JSON::null, begin => JSON::null, end => JSON::null, ended => JSON::false }, + { name => 'Beat of Angel', 'sort-name' => 'Beat of Angel', locale => JSON::null, primary => JSON::null, type => JSON::null, 'type-id' => JSON::null, begin => '1001-01-10', end => '2002-02-20', ended => JSON::true }, + { name => 'BoA Kwon', 'sort-name' => 'BoA Kwon', locale => JSON::null, primary => JSON::null, type => JSON::null, 'type-id' => JSON::null, begin => JSON::null, end => JSON::null, ended => JSON::true }, { name => 'Kwon BoA', 'sort-name' => 'Kwon BoA', locale => JSON::null, primary => JSON::null, type => JSON::null, 'type-id' => JSON::null, begin => JSON::null, end => JSON::null, ended => JSON::false }, - { name => 'ボア', 'sort-name' => 'ボア', locale => JSON::null, primary => JSON::null, type => JSON::null, 'type-id' => JSON::null, begin => JSON::null, end => JSON::null, ended => JSON::false }, - { name => '보아', 'sort-name' => '보아', locale => JSON::null, primary => JSON::null, type => JSON::null, 'type-id' => JSON::null, begin => JSON::null, end => JSON::null, ended => JSON::false }, + { name => 'ボア', 'sort-name' => 'ボア', locale => JSON::null, primary => JSON::null, type => 'Artist name', 'type-id' => '894afba6-2816-3c24-8072-eadb66bd04bc', begin => JSON::null, end => JSON::null, ended => JSON::false }, + { name => '보아', 'sort-name' => '보아', locale => 'ko', primary => JSON::true, type => JSON::null, 'type-id' => JSON::null, begin => JSON::null, end => JSON::null, ended => JSON::false }, ], ipis => [], isnis => [], diff --git a/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/LookupArtist.pm b/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/LookupArtist.pm index aa6d43fb421..813e77114b8 100644 --- a/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/LookupArtist.pm +++ b/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/LookupArtist.pm @@ -122,11 +122,11 @@ test 'basic artist lookup, inc=aliases' => sub { type => 'Person', 'type-id' => 'b6e035f4-3ce9-331c-97df-83397230b0df', aliases => [ - { name => 'Beat of Angel', 'sort-name' => 'Beat of Angel', locale => JSON::null, primary => JSON::null, type => JSON::null, 'type-id' => JSON::null, begin => JSON::null, end => JSON::null, ended => JSON::false }, - { name => 'BoA Kwon', 'sort-name' => 'BoA Kwon', locale => JSON::null, primary => JSON::null, type => JSON::null, 'type-id' => JSON::null, begin => JSON::null, end => JSON::null, ended => JSON::false }, + { name => 'Beat of Angel', 'sort-name' => 'Beat of Angel', locale => JSON::null, primary => JSON::null, type => JSON::null, 'type-id' => JSON::null, begin => '1001-01-10', end => '2002-02-20', ended => JSON::true }, + { name => 'BoA Kwon', 'sort-name' => 'BoA Kwon', locale => JSON::null, primary => JSON::null, type => JSON::null, 'type-id' => JSON::null, begin => JSON::null, end => JSON::null, ended => JSON::true }, { name => 'Kwon BoA', 'sort-name' => 'Kwon BoA', locale => JSON::null, primary => JSON::null, type => JSON::null, 'type-id' => JSON::null, begin => JSON::null, end => JSON::null, ended => JSON::false }, - { name => 'ボア', 'sort-name' => 'ボア', locale => JSON::null, primary => JSON::null, type => JSON::null, 'type-id' => JSON::null, begin => JSON::null, end => JSON::null, ended => JSON::false }, - { name => '보아', 'sort-name' => '보아', locale => JSON::null, primary => JSON::null, type => JSON::null, 'type-id' => JSON::null, begin => JSON::null, end => JSON::null, ended => JSON::false }, + { name => 'ボア', 'sort-name' => 'ボア', locale => JSON::null, primary => JSON::null, type => 'Artist name', 'type-id' => '894afba6-2816-3c24-8072-eadb66bd04bc', begin => JSON::null, end => JSON::null, ended => JSON::false }, + { name => '보아', 'sort-name' => '보아', locale => 'ko', primary => JSON::true, type => JSON::null, 'type-id' => JSON::null, begin => JSON::null, end => JSON::null, ended => JSON::false }, ], ipis => [], isnis => [], diff --git a/t/lib/t/MusicBrainz/Server/Controller/WS/2/LookupArtist.pm b/t/lib/t/MusicBrainz/Server/Controller/WS/2/LookupArtist.pm index 05c4337bb49..9e4aba4f222 100644 --- a/t/lib/t/MusicBrainz/Server/Controller/WS/2/LookupArtist.pm +++ b/t/lib/t/MusicBrainz/Server/Controller/WS/2/LookupArtist.pm @@ -59,11 +59,11 @@ ws_test 'artist lookup, inc=aliases', 1986-11-05 - Beat of Angel - BoA Kwon + Beat of Angel + BoA Kwon Kwon BoA - ボア - 보아 + ボア + 보아 '; diff --git a/t/lib/t/MusicBrainz/Server/Controller/WS/2/LookupRelease.pm b/t/lib/t/MusicBrainz/Server/Controller/WS/2/LookupRelease.pm index 45b5a07518c..78f76d51bc9 100644 --- a/t/lib/t/MusicBrainz/Server/Controller/WS/2/LookupRelease.pm +++ b/t/lib/t/MusicBrainz/Server/Controller/WS/2/LookupRelease.pm @@ -1432,11 +1432,11 @@ ws_test 'release lookup, track artists have no aliases', BoABoA - Beat of Angel - BoA Kwon + Beat of Angel + BoA Kwon Kwon BoA - ボア - 보아 + ボア + 보아 @@ -1487,11 +1487,11 @@ ws_test 'release lookup, track artists have no aliases', BoABoA - Beat of Angel - BoA Kwon + Beat of Angel + BoA Kwon Kwon BoA - ボア - 보아 + ボア + 보아 diff --git a/t/sql/webservice.sql b/t/sql/webservice.sql index f1ea1b8e877..183a8daa847 100644 --- a/t/sql/webservice.sql +++ b/t/sql/webservice.sql @@ -104,11 +104,11 @@ INSERT INTO artist_alias (artist, begin_date_day, begin_date_month, begin_date_y INSERT INTO artist_alias (artist, begin_date_day, begin_date_month, begin_date_year, edits_pending, end_date_day, end_date_month, end_date_year, id, last_updated, locale, name, primary_for_locale, sort_name, type) VALUES (135345, NULL, NULL, NULL, 0, NULL, NULL, NULL, 38930, '2011-01-18 15:20:17.74049+00', NULL, 'm-flow', '0', 'm-flow', NULL); INSERT INTO artist_alias (artist, begin_date_day, begin_date_month, begin_date_year, edits_pending, end_date_day, end_date_month, end_date_year, id, last_updated, locale, name, primary_for_locale, sort_name, type) VALUES (135345, NULL, NULL, NULL, 0, NULL, NULL, NULL, 69814, '2011-01-18 15:20:17.74049+00', NULL, 'えむふろう', '0', 'えむふろう', NULL); INSERT INTO artist_alias (artist, begin_date_day, begin_date_month, begin_date_year, edits_pending, end_date_day, end_date_month, end_date_year, id, last_updated, locale, name, primary_for_locale, sort_name, type) VALUES (135345, NULL, NULL, NULL, 0, NULL, NULL, NULL, 69815, '2011-01-18 15:20:17.74049+00', NULL, 'エムフロウ', '0', 'エムフロウ', NULL); -INSERT INTO artist_alias (artist, begin_date_day, begin_date_month, begin_date_year, edits_pending, end_date_day, end_date_month, end_date_year, id, last_updated, locale, name, primary_for_locale, sort_name, type) VALUES (9496, NULL, NULL, NULL, 0, NULL, NULL, NULL, 11905, '2011-01-18 15:20:17.74049+00', NULL, 'Beat of Angel', '0', 'Beat of Angel', NULL); -INSERT INTO artist_alias (artist, begin_date_day, begin_date_month, begin_date_year, edits_pending, end_date_day, end_date_month, end_date_year, id, last_updated, locale, name, primary_for_locale, sort_name, type) VALUES (9496, NULL, NULL, NULL, 0, NULL, NULL, NULL, 70378, '2011-01-18 15:20:17.74049+00', NULL, 'ボア', '0', 'ボア', NULL); -INSERT INTO artist_alias (artist, begin_date_day, begin_date_month, begin_date_year, edits_pending, end_date_day, end_date_month, end_date_year, id, last_updated, locale, name, primary_for_locale, sort_name, type) VALUES (9496, NULL, NULL, NULL, 0, NULL, NULL, NULL, 11902, '2011-01-18 15:20:17.74049+00', NULL, 'BoA Kwon', '0', 'BoA Kwon', NULL); +INSERT INTO artist_alias (artist, begin_date_day, begin_date_month, begin_date_year, edits_pending, end_date_day, end_date_month, end_date_year, id, last_updated, locale, name, primary_for_locale, sort_name, type) VALUES (9496, 10, 01, 1001, 0, 20, 02, 2002, 11905, '2011-01-18 15:20:17.74049+00', NULL, 'Beat of Angel', '0', 'Beat of Angel', NULL); +INSERT INTO artist_alias (artist, begin_date_day, begin_date_month, begin_date_year, edits_pending, end_date_day, end_date_month, end_date_year, id, last_updated, locale, name, primary_for_locale, sort_name, type) VALUES (9496, NULL, NULL, NULL, 0, NULL, NULL, NULL, 70378, '2011-01-18 15:20:17.74049+00', NULL, 'ボア', '0', 'ボア', 1); +INSERT INTO artist_alias (artist, begin_date_day, begin_date_month, begin_date_year, edits_pending, end_date_day, end_date_month, end_date_year, id, last_updated, locale, name, primary_for_locale, sort_name, type, ended) VALUES (9496, NULL, NULL, NULL, 0, NULL, NULL, NULL, 11902, '2011-01-18 15:20:17.74049+00', NULL, 'BoA Kwon', '0', 'BoA Kwon', NULL, '1'); INSERT INTO artist_alias (artist, begin_date_day, begin_date_month, begin_date_year, edits_pending, end_date_day, end_date_month, end_date_year, id, last_updated, locale, name, primary_for_locale, sort_name, type) VALUES (9496, NULL, NULL, NULL, 0, NULL, NULL, NULL, 11901, '2011-01-18 15:20:17.74049+00', NULL, 'Kwon BoA', '0', 'Kwon BoA', NULL); -INSERT INTO artist_alias (artist, begin_date_day, begin_date_month, begin_date_year, edits_pending, end_date_day, end_date_month, end_date_year, id, last_updated, locale, name, primary_for_locale, sort_name, type) VALUES (9496, NULL, NULL, NULL, 0, NULL, NULL, NULL, 18652, '2011-01-18 15:20:17.74049+00', NULL, '보아', '0', '보아', NULL); +INSERT INTO artist_alias (artist, begin_date_day, begin_date_month, begin_date_year, edits_pending, end_date_day, end_date_month, end_date_year, id, last_updated, locale, name, primary_for_locale, sort_name, type) VALUES (9496, NULL, NULL, NULL, 0, NULL, NULL, NULL, 18652, '2011-01-18 15:20:17.74049+00', 'ko', '보아', '1', '보아', NULL); INSERT INTO artist_alias (artist, begin_date_day, begin_date_month, begin_date_year, edits_pending, end_date_day, end_date_month, end_date_year, id, last_updated, locale, name, primary_for_locale, sort_name, type) VALUES (242, NULL, NULL, NULL, 0, NULL, NULL, NULL, 34446, '2011-01-18 15:20:17.74049+00', NULL, 'Chemical Brother', '0', 'Chemical Brother', NULL); INSERT INTO artist_alias (artist, begin_date_day, begin_date_month, begin_date_year, edits_pending, end_date_day, end_date_month, end_date_year, id, last_updated, locale, name, primary_for_locale, sort_name, type) VALUES (242, NULL, NULL, NULL, 0, NULL, NULL, NULL, 381, '2011-01-18 15:20:17.74049+00', NULL, 'CHEMICAL BROTHERS', '0', 'CHEMICAL BROTHERS', NULL); INSERT INTO artist_alias (artist, begin_date_day, begin_date_month, begin_date_year, edits_pending, end_date_day, end_date_month, end_date_year, id, last_updated, locale, name, primary_for_locale, sort_name, type) VALUES (242, NULL, NULL, NULL, 0, NULL, NULL, NULL, 2207, '2011-01-18 15:20:17.74049+00', NULL, 'Chemical Brothers', '0', 'Chemical Brothers', NULL);