From 707b36cdd4e69e4c24e6b7f07a36a2ca5300536f Mon Sep 17 00:00:00 2001 From: SuperSaltyGamer Date: Wed, 31 Dec 2025 16:34:00 +0200 Subject: [PATCH 1/4] MBS-14224: Add myanimelist.net to the otherdbs whitelist --- lib/MusicBrainz/Server/Data/URL.pm | 1 + .../Server/Entity/URL/MyAnimeList.pm | 22 ++++++++++++++ .../external-favicons/myanimelist-32.png | Bin 0 -> 871 bytes root/static/scripts/common/constants.js | 1 + root/static/scripts/edit/URLCleanup.js | 28 ++++++++++++++++++ .../scripts/tests/Control/URLCleanup.js | 22 ++++++++++++++ root/static/styles/favicons.less | 1 + 7 files changed, 75 insertions(+) create mode 100644 lib/MusicBrainz/Server/Entity/URL/MyAnimeList.pm create mode 100644 root/static/images/external-favicons/myanimelist-32.png diff --git a/lib/MusicBrainz/Server/Data/URL.pm b/lib/MusicBrainz/Server/Data/URL.pm index 74d2a90c524..a7fbd7c94df 100644 --- a/lib/MusicBrainz/Server/Data/URL.pm +++ b/lib/MusicBrainz/Server/Data/URL.pm @@ -144,6 +144,7 @@ my %URL_SPECIALIZATIONS = ( 'Muziekweb' => qr{^https?://www\.muziekweb\.nl/}i, 'Muzikum' => qr{^https?://(?:www\.)?muzikum\.eu/}i, 'MVDbase' => qr{^https?://(?:www\.)?mvdbase\.com/}i, + 'MyAnimeList' => qr{^https?://(?:www\.)?myanimelist\.net/}i, 'MySpace' => qr{^https?://(?:www\.)?myspace\.com/}i, 'Napster' => qr{^https?://[\w-]{2}\.napster\.com/}i, 'NDL' => qr{^https?://(?:www\.)?iss\.ndl\.go\.jp/}i, diff --git a/lib/MusicBrainz/Server/Entity/URL/MyAnimeList.pm b/lib/MusicBrainz/Server/Entity/URL/MyAnimeList.pm new file mode 100644 index 00000000000..a76d0b155f8 --- /dev/null +++ b/lib/MusicBrainz/Server/Entity/URL/MyAnimeList.pm @@ -0,0 +1,22 @@ +package MusicBrainz::Server::Entity::URL::MyAnimeList; + +use Moose; + +extends 'MusicBrainz::Server::Entity::URL'; +with 'MusicBrainz::Server::Entity::URL::Sidebar'; + +sub sidebar_name { 'MyAnimeList' } + +__PACKAGE__->meta->make_immutable; +no Moose; +1; + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2026 MetaBrainz Foundation + +This file is part of MusicBrainz, the open internet music database, +and is licensed under the GPL version 2, or (at your option) any +later version: http://www.gnu.org/licenses/gpl-2.0.txt + +=cut diff --git a/root/static/images/external-favicons/myanimelist-32.png b/root/static/images/external-favicons/myanimelist-32.png new file mode 100644 index 0000000000000000000000000000000000000000..40bfbed8db8c9c65ac9eda2dada735486ebefa69 GIT binary patch literal 871 zcmV-t1DO1YP)6X^%3uY$fI6V2yQ$nQ%!@w&idRU~AB{k% zi1g%y+3xqH+h~faO8VCVM)Tqcxivi%%z!ZbujPeA9 zLf~LtGNK@0vdq!??wi*l;p^70Wm5zx32Ky~3IHBG@5kEj%z{q@#C&Q>B^g z-VukzYWHcts|4|}>$$AY0YJNTBd1C;ePs?+_*xpO3q8bLE;m-21FOx!?({gHaXvHf zFGurJ>FAx{WJxBXDEJJ#cw!H+QPLOOH#E(S+75Cu;z&!00^oJm=+X@Ua!GuV5WAjZ z2T}nrnrG2peTK<0$MM4L2>v>YVYRQ5D8E`t?oV(tF)9LmZ6sBAw&nrCpm>HV`fSZ^0vnRma zzo3ENi~HmEL8VX#Y)g)$ZT@VqJDh%FLPHf)RqEvN$G-10w+;F?un_&j)ADuR&Uo2? z%jG{NL?KdkC`}#@jY=;O0${StF)(5Pz-*oK3LYB!iP1dE$iz{%a zSz>tx)T&SvqTqE#ES4qh0RZECikC~!{|8nLh)C^Hu&|0qy;`v76p Date: Mon, 5 Jan 2026 18:30:36 +0200 Subject: [PATCH 2/4] MBS-14224: Update myanimelist.net urlcleanup artist test --- root/static/scripts/tests/Control/URLCleanup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/static/scripts/tests/Control/URLCleanup.js b/root/static/scripts/tests/Control/URLCleanup.js index 48b536c561b..159f4f3dc44 100644 --- a/root/static/scripts/tests/Control/URLCleanup.js +++ b/root/static/scripts/tests/Control/URLCleanup.js @@ -4634,7 +4634,7 @@ limited_link_type_combinations: [ only_valid_entity_types: ['artist'], }, { - input_url: 'https://myanimelist.net/character/40/Luffy_Monkey_D', + input_url: 'https://myanimelist.net/character/40/Luffy_Monkey_D/clubs', input_entity_type: 'artist', expected_relationship_type: 'otherdatabases', expected_clean_url: 'https://myanimelist.net/character/40', From bb76b0e900c3e2b2108de8f43d2f9da6140f969f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Tamargo?= Date: Mon, 5 Jan 2026 17:44:47 +0100 Subject: [PATCH 3/4] Fix eslint issues --- root/static/scripts/edit/URLCleanup.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/root/static/scripts/edit/URLCleanup.js b/root/static/scripts/edit/URLCleanup.js index d2879414d6e..da0bbc64f30 100644 --- a/root/static/scripts/edit/URLCleanup.js +++ b/root/static/scripts/edit/URLCleanup.js @@ -4690,13 +4690,13 @@ export const CLEANUPS: CleanupEntries = { switch (id) { case LINK_TYPES.otherdatabases.artist: return { - result: prefix === "people" || prefix === "character", - target: ERROR_TARGETS.ENTITY + result: prefix === 'people' || prefix === 'character', + target: ERROR_TARGETS.ENTITY, }; case LINK_TYPES.otherdatabases.label: return { result: prefix === 'anime/producer', - target: ERROR_TARGETS.ENTITY + target: ERROR_TARGETS.ENTITY, }; } return {result: false, target: ERROR_TARGETS.RELATIONSHIP}; From ca9a2cc0c22a1ee8076fee55169436c1e92f4b47 Mon Sep 17 00:00:00 2001 From: SuperSaltyGamer Date: Wed, 7 Jan 2026 18:32:16 +0200 Subject: [PATCH 4/4] MBS-14224: Validate myanimelist.net validate against the cleaned URL format --- root/static/scripts/edit/URLCleanup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/static/scripts/edit/URLCleanup.js b/root/static/scripts/edit/URLCleanup.js index d2879414d6e..b76f2cf8920 100644 --- a/root/static/scripts/edit/URLCleanup.js +++ b/root/static/scripts/edit/URLCleanup.js @@ -4684,7 +4684,7 @@ export const CLEANUPS: CleanupEntries = { return url.replace(/^(?:https?:\/\/)?(?:www\.)?myanimelist\.net\/(people|character|anime\/producer)\/(\d+).*$/, 'https://myanimelist.net/$1/$2'); }, validate(url, id) { - const m = /^(?:https?:\/\/)?(?:www\.)?myanimelist\.net\/(people|character|anime\/producer)\/(\d+)$/.exec(url); + const m = /^https:\/\/myanimelist\.net\/(people|character|anime\/producer)\/(\d+)$/.exec(url); if (m) { const prefix = m[1]; switch (id) {