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-13884: Add ACUM to whitelist for other databases #3454

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dvirtz
Copy link
Contributor

@dvirtz dvirtz commented Jan 26, 2025

Problem

MBS-13884

Solution

white list nocs.acum.org.il links as 'other database'

Testing

Tested adding ACUM links to artists, albums and works.

@dvirtz dvirtz changed the title MBS-13884 MBS-13884: Add ACUM to whitelist for other databases Jan 27, 2025
@@ -20,6 +20,7 @@ my %URL_SPECIALIZATIONS = (
# External links section
'45cat' => qr{^https?://(?:www\.)?45cat\.com/}i,
'45worlds' => qr{^https?://(?:www\.)?45worlds\.com/}i,
'ACUM' => qr{^https?://nocs.acum.org.il/acumsitesearchdb/}i,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels like skipping acumsitesearchdb might be fine, but you might know better. You should escape the dots so they match just dots and not anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

return url.replace(/&.*/, '').replace('/version?', '/work?');
},
validate(url, id) {
const m = /^(https:\/\/)?nocs\.acum\.org\.il\/acumsitesearchdb\//i.test(url);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally the point of m is to extract a part of the URL you're going to compare against. It would make sense to either rename this to "isAcumLink" or whatnot, or actually extract the bits you want to compare against here already.

Also, don't do (https:\/\/)? here - clean the URL up to always have the same (probably https://?) as part of the clean method above (we do that for many URLs, just copy it). Then just use the expected clean format here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.
I did the match here in the initial implementation but the regex got too complicated with all the different supported entities.

}
case LINK_TYPES.otherdatabases.label:
return {
result: /\/results\?(creatorid=I-\d+-\d|creatoripnnumber=\d+)$/.test(url),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an actual page? It looks like a search URL, but I cannot see it since it still blocks me, so :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the page you get to when clicking a label name. Same for artist.

@dvirtz
Copy link
Contributor Author

dvirtz commented Feb 4, 2025

@reosarevok is there anything left for me to do?

@reosarevok
Copy link
Member

It might be fine now :) I'm hoping one of my teammates with proper access to the site can give this a last test - maybe @mwiencek can see it?

@reosarevok
Copy link
Member

Ok, @mwiencek could see it and sent me some screenshots. The search result pages are search results, even if you open them by clicking the name. That's common on libraries, and we still don't support linking to them since they're not pages for the entity, just searches.

The work (and arrangement) pages seem fine. It's unclear if versions should be cleaned up to works - I understand they can and often have different ISWCs? Maybe we should support them as-is as well?

Album is a bit weird but it seems a decent fit, so I guess we can have it too.

@dvirtz
Copy link
Contributor Author

dvirtz commented Feb 4, 2025

The creatorid links are the main motivation of this ticket, to be able to identify artists that don't have IPI.
It's not a fuzzy text search, all the results are actually linked to that creator.

@reosarevok
Copy link
Member

Ok, I guess since it goes straight to the ID, and you already wrote it, maybe it's still ok to have... not a huge fan, but I can see how it's halfway to a normal page that way, so :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants