Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MBS-13885: Use jaxsta.io instead of jaxsta.com #3435

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion lib/MusicBrainz/Server/Data/URL.pm
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ my %URL_SPECIALIZATIONS = (
'iTunes' => qr{^https?://itunes\.apple\.com/}i,
'Jamendo' => qr{^https?://(?:www\.)?jamendo\.com/}i,
'Japameta' => qr{^https?://(?:www\.)?japanesemetal\.gooside\.com/}i,
'Jaxsta' => qr{^https?://(?:www\.)?jaxsta\.com/}i,
'Jaxsta' => qr{^https?://(?:www\.)?jaxsta\.(?:com|io)/}i,
'JazzMusicArchives' => qr{^https?://(?:www\.)?jazzmusicarchives\.com/}i,
'JLyric' => qr{^https?://(?:www\.)?j-lyric\.net/}i,
'Joysound' => qr{^https?://(?:www\.)?joysound\.com/}i,
Expand Down
2 changes: 1 addition & 1 deletion root/static/scripts/common/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const FAVICON_CLASSES: {
'iss.ndl.go.jp': 'ndl',
'itunes.apple.com': 'itunes',
'j-lyric.net': 'jlyric',
'jaxsta.com': 'jaxsta',
'jaxsta.io': 'jaxsta',
'jazzmusicarchives.com': 'jazzmusicarchives',
'joysound.com': 'joysound',
'junodownload.com': 'junodownload',
Expand Down
10 changes: 5 additions & 5 deletions root/static/scripts/edit/URLCleanup.js
Original file line number Diff line number Diff line change
Expand Up @@ -3198,13 +3198,13 @@ const CLEANUPS: CleanupEntries = {
},
},
'jaxsta': {
match: [/^(https?:\/\/)?(www\.)?jaxsta\.com/i],
match: [/^(https?:\/\/)?(www\.)?jaxsta\.(com|io)/i],
restrict: [
LINK_TYPES.otherdatabases,
{work: [LINK_TYPES.otherdatabases.work, LINK_TYPES.lyrics.work]},
],
select(url, sourceType) {
const m = /^https:\/\/jaxsta\.com\/(\w+)\/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}(?:\/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})?$/.exec(url);
const m = /^https:\/\/jaxsta\.io\/(\w+)\/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}(?:\/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})?$/.exec(url);
if (m) {
const prefix = m[1];
switch (prefix) {
Expand All @@ -3218,12 +3218,12 @@ const CLEANUPS: CleanupEntries = {
return false;
},
clean(url) {
url = url.replace(/^(?:https?:\/\/)?(?:www\.)?jaxsta\.com\/([^#?]+).*$/, 'https://jaxsta.com/$1');
url = url.replace(/^https:\/\/jaxsta\.com\/(\w+)\/([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})(\/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})?.*$/, 'https://jaxsta.com/$1/$2$3');
url = url.replace(/^(?:https?:\/\/)?(?:www\.)?jaxsta\.(?:com|io)\/([^#?]+).*$/, 'https://jaxsta.io/$1');
url = url.replace(/^https:\/\/jaxsta\.io\/(\w+)\/([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})(\/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})?.*$/, 'https://jaxsta.io/$1/$2$3');
return url;
},
validate(url, id) {
const m = /^https:\/\/jaxsta\.com\/(\w+)\/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}(\/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})?$/.exec(url);
const m = /^https:\/\/jaxsta\.io\/(\w+)\/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}(\/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})?$/.exec(url);
if (m) {
const type = m[1];
const hasVariant = Boolean(m[2]);
Expand Down
17 changes: 12 additions & 5 deletions root/static/scripts/tests/Control/URLCleanup.js
Original file line number Diff line number Diff line change
Expand Up @@ -3214,28 +3214,35 @@ limited_link_type_combinations: [
input_url: 'http://www.jaxsta.com/profile/8a9bd5c6-1ce2-4f1d-bfdc-1a2383129c79/catalogue?role_group=Featured%20Artist&view=tile',
input_entity_type: 'artist',
expected_relationship_type: 'otherdatabases',
expected_clean_url: 'https://jaxsta.com/profile/8a9bd5c6-1ce2-4f1d-bfdc-1a2383129c79',
expected_clean_url: 'https://jaxsta.io/profile/8a9bd5c6-1ce2-4f1d-bfdc-1a2383129c79',
only_valid_entity_types: ['artist', 'label'],
},
{
input_url: 'https://jaxsta.io/profile/902b15e8-ed89-41d7-a7c0-a35caf2c2801/credits',
input_entity_type: 'artist',
expected_relationship_type: 'otherdatabases',
expected_clean_url: 'https://jaxsta.io/profile/902b15e8-ed89-41d7-a7c0-a35caf2c2801',
only_valid_entity_types: ['artist', 'label'],
},
{
input_url: 'https://jaxsta.com/profile/5a50b1be-7473-4e51-ae4b-bb8d9ac13407/catalogue?view=tile',
input_entity_type: 'label',
expected_relationship_type: 'otherdatabases',
expected_clean_url: 'https://jaxsta.com/profile/5a50b1be-7473-4e51-ae4b-bb8d9ac13407',
expected_clean_url: 'https://jaxsta.io/profile/5a50b1be-7473-4e51-ae4b-bb8d9ac13407',
only_valid_entity_types: ['artist', 'label'],
},
{
input_url: 'https://jaxsta.com/recording/5b01140a-a82f-5f5c-aa81-93d61de00f94/releases',
input_entity_type: 'recording',
expected_relationship_type: 'otherdatabases',
expected_clean_url: 'https://jaxsta.com/recording/5b01140a-a82f-5f5c-aa81-93d61de00f94',
expected_clean_url: 'https://jaxsta.io/recording/5b01140a-a82f-5f5c-aa81-93d61de00f94',
only_valid_entity_types: ['recording'],
},
{
input_url: 'https://jaxsta.com/release/66512305-5fb7-5d43-a194-d5ed56c16cab/7c5528fe-96f7-5c0c-9af2-9b756b909436/variants',
input_entity_type: 'release',
expected_relationship_type: 'otherdatabases',
expected_clean_url: 'https://jaxsta.com/release/66512305-5fb7-5d43-a194-d5ed56c16cab/7c5528fe-96f7-5c0c-9af2-9b756b909436',
expected_clean_url: 'https://jaxsta.io/release/66512305-5fb7-5d43-a194-d5ed56c16cab/7c5528fe-96f7-5c0c-9af2-9b756b909436',
only_valid_entity_types: ['release'],
},
{
Expand All @@ -3246,7 +3253,7 @@ limited_link_type_combinations: [
'otherdatabases',
['lyrics', 'otherdatabases'],
],
expected_clean_url: 'https://jaxsta.com/work/2aa4e869-85d4-5099-92fb-5a8aa1494d32',
expected_clean_url: 'https://jaxsta.io/work/2aa4e869-85d4-5099-92fb-5a8aa1494d32',
only_valid_entity_types: ['work'],
},
// Jazz Music Archives
Expand Down