Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/MusicBrainz/Server/Data/URL.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
22 changes: 22 additions & 0 deletions lib/MusicBrainz/Server/Entity/URL/MyAnimeList.pm
Original file line number Diff line number Diff line change
@@ -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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions root/static/scripts/common/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ export const FAVICON_CLASSES: {
'musopen.org': 'musopen',
'muziekweb.nl': 'muziekweb',
'muzikum.eu': 'muzikum',
'myanimelist.net': 'myanimelist',
'myspace.com': 'myspace',
'napster.com': 'napster',
'nicovideo.jp': 'niconicovideo',
Expand Down
28 changes: 28 additions & 0 deletions root/static/scripts/edit/URLCleanup.js
Original file line number Diff line number Diff line change
Expand Up @@ -4676,6 +4676,34 @@ export const CLEANUPS: CleanupEntries = {
return {result: false, target: ERROR_TARGETS.URL};
},
},
'myanimelist': {
hostname: 'myanimelist.net',
match: [/^(?:https?:\/\/)?(?:www\.)?myanimelist\.net/i],
restrict: [LINK_TYPES.otherdatabases],
clean(url) {
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);
if (m) {
const prefix = m[1];
switch (id) {
case LINK_TYPES.otherdatabases.artist:
return {
result: prefix === "people" || prefix === "character",
target: ERROR_TARGETS.ENTITY
};
case LINK_TYPES.otherdatabases.label:
return {
result: prefix === 'anime/producer',
target: ERROR_TARGETS.ENTITY
};
}
return {result: false, target: ERROR_TARGETS.RELATIONSHIP};
}
return {result: false, target: ERROR_TARGETS.URL};
},
},
'myspace': {
hostname: ['myspace.com', 'myspace.de', 'myspace.fr'],
match: [/^(https?:\/\/)?([^/]+\.)?myspace\.(com|de|fr)/i],
Expand Down
22 changes: 22 additions & 0 deletions root/static/scripts/tests/Control/URLCleanup.js
Original file line number Diff line number Diff line change
Expand Up @@ -4625,6 +4625,28 @@ limited_link_type_combinations: [
input_entity_type: 'recording',
expected_relationship_type: 'otherdatabases',
},
// MyAnimeList
{
input_url: 'https://myanimelist.net/people/185/Kana_Hanazawa',
input_entity_type: 'artist',
expected_relationship_type: 'otherdatabases',
expected_clean_url: 'https://myanimelist.net/people/185',
only_valid_entity_types: ['artist'],
},
{
input_url: 'https://myanimelist.net/character/40/Luffy_Monkey_D',
input_entity_type: 'artist',
expected_relationship_type: 'otherdatabases',
expected_clean_url: 'https://myanimelist.net/character/40',
only_valid_entity_types: ['artist'],
},
{
input_url: 'https://myanimelist.net/anime/producer/1696/Kadokawa',
input_entity_type: 'label',
expected_relationship_type: 'otherdatabases',
expected_clean_url: 'https://myanimelist.net/anime/producer/1696',
only_valid_entity_types: ['label'],
},
// Myspace
{
input_url: 'https://myspace.com/instramentaluk',
Expand Down
1 change: 1 addition & 0 deletions root/static/styles/favicons.less
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
.favicon("musopen", 32);
.favicon("muziekweb", 32);
.favicon("muzikum", 32);
.favicon("myanimelist", 32);
.favicon("myspace", 32);
.favicon("napster", 32);
.favicon("ndl");
Expand Down
Loading