Skip to content

Commit f610bae

Browse files
committed
MBS-14152: Added Livenation Thailand URL Recognition
fixed testcases
1 parent 33a798c commit f610bae

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

root/static/scripts/edit/URLCleanup.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3961,10 +3961,11 @@ export const CLEANUPS: CleanupEntries = {
39613961
},
39623962
},
39633963
'livenation': {
3964-
hostname: 'livenation.*',
3965-
match: [/^(https?:\/\/)?(?:(?:concerts|www)\.)?livenation\.(?:[a-z]{2,3}?\.)?[a-z]{2,4}\//i],
3964+
hostname: ['livenation.*', 'livenationtero.co.th'],
3965+
match: [/^(https?:\/\/)?(?:(?:concerts|www)\.)?livenation\.(?:[a-z]{2,3}?\.)?[a-z]{2,4}\//i, /^(https?:\/\/)?(?:www\.)?livenationtero\.co\.th\//i],
39663966
restrict: [LINK_TYPES.ticketing],
39673967
clean(url) {
3968+
url = url.replace(/^(?:https?:\/\/)?(?:www\.)?livenationtero\.co\.th\//, 'https://www.livenation.co.th/');
39683969
url = url.replace(/^(?:https?:\/\/)?concerts\.livenation\.com\/(?:[\w\d-]+\/)?event\/([0-9A-F]+).*$/, 'https://concerts.livenation.com/event/$1');
39693970
url = url.replace(/^(?:https?:\/\/)?(?:www\.)?livenation\.com\/(artist|event|venue)\/([\w-]+).*$/, 'https://www.livenation.com/$1/$2');
39703971
// International sites use somewhat different formats

root/static/scripts/tests/Control/URLCleanup.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3942,6 +3942,41 @@ limited_link_type_combinations: [
39423942
expected_clean_url: 'https://www.livenation.ee/venue/953330',
39433943
only_valid_entity_types: ['place'],
39443944
},
3945+
{
3946+
input_url: 'https://www.livenationtero.co.th/artist-alice-cooper-332374?omq=alice-cooper',
3947+
input_entity_type: 'artist',
3948+
expected_relationship_type: 'ticketing',
3949+
expected_clean_url: 'https://www.livenation.co.th/artist-332374',
3950+
only_valid_entity_types: ['artist'],
3951+
},
3952+
{
3953+
input_url: 'https://www.livenationtero.co.th/show/1431241/anna-of-the-north/bangkok/2023-09-14/en',
3954+
input_entity_type: 'event',
3955+
expected_relationship_type: 'ticketing',
3956+
expected_clean_url: 'https://www.livenation.co.th/show/1431241',
3957+
only_valid_entity_types: ['event'],
3958+
},
3959+
{
3960+
input_url: 'https://www.livenationtero.co.th/venue/KovZpZAEAFeA/impact-muang-thong-thani-events#seat-map',
3961+
input_entity_type: 'place',
3962+
expected_relationship_type: 'ticketing',
3963+
expected_clean_url: 'https://www.livenation.co.th/venue/KovZpZAEAFeA',
3964+
only_valid_entity_types: ['place'],
3965+
},
3966+
{
3967+
input_url: 'https://livenationtero.co.th/artist-coldplay-123456/extra-params#info',
3968+
input_entity_type: 'artist',
3969+
expected_relationship_type: 'ticketing',
3970+
expected_clean_url: 'https://www.livenation.co.th/artist-123456',
3971+
only_valid_entity_types: ['artist'],
3972+
},
3973+
{
3974+
input_url: 'https://livenationtero.co.th/show/999999/concert-name/city/2024-01-15/en',
3975+
input_entity_type: 'event',
3976+
expected_relationship_type: 'ticketing',
3977+
expected_clean_url: 'https://www.livenation.co.th/show/999999',
3978+
only_valid_entity_types: ['event'],
3979+
},
39453980
// Loudr
39463981
{
39473982
input_url: 'https://loudr.fm/artist/kyle-landry/Z77SM?test',

0 commit comments

Comments
 (0)