-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat(caa dims): add support for new event art archive (EAA) #779
feat(caa dims): add support for new event art archive (EAA) #779
Conversation
vzell request: https://community.metabrainz.org/t/ropdebees-userscripts-support-thread/551947/182 Tested with: https://musicbrainz.org/event/d1bd6d40-55f6-4e1a-91df-4c9395f95401 and sub-pages (/event-art, /edits)
Apply eslint unreadable unicorn/prefer-regexp-test preference To pass the tests in ROpdebee#779
/deploy-preview You can use I will see if I find some time to review your PRs as ROpdebee seems to be busy. |
feat(caa dims): add support for new event art archive (EAA) (#779)
This PR changes 1 built userscript(s):
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, I've tested the preview and everything works as expected.
Regarding the code I have one minor suggestion.
P.S. There are a few more places where the wording could be changed from specifically CAA to the more general "image archives" (the name which is also used on MetaBrainz Jira), but that is not required here and I will leave that decision up to ROpdebee.
src/mb_caa_dimensions/image.ts
Outdated
@@ -110,7 +110,7 @@ function urlToCacheKey(fullSizeUrl: string, thumbnailUrl?: string): string { | |||
// Ideally, the cache key for RG covers would be the full size URL of the release cover, | |||
// but we unfortunately cannot get the original image's extension here, so we cannot construct | |||
// it. | |||
if (urlObject.host === CAA_DOMAIN && urlObject.pathname.startsWith('/release-group/')) { | |||
if (AA_DOMAINS.test(urlObject.host) && urlObject.pathname.startsWith('/release-group/')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this code branch only deals with release group cover art, you can revert this change (and restore the CAA_DOMAIN constant in addition to the regex).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not.
But that would make two constants (CAA_DOMAIN
and AA_DOMAINS
*) instead of one.
What do you think @ROpdebee?
* AA_DOMAINS
should probably become IMG_DOMAINS
, see #779 (review)
CAA
project was renamed to IMG
in https://tickets.metabrainz.org where IMG = CAA + EAA
😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I included this revert change in 2041f59.
- Revert unnecessary release group change ROpdebee#779 (comment) - Use IMG (image archives https://tickets.metabrainz.org/projects/IMG) instead of AA (art archives) ROpdebee#779 (review)
I didn't manage tu build ( $ npm run build
> [email protected] build
> NODE_ENV=production tsx build/build.ts
'NODE_ENV' n’est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes. I tried some tips from stackoverflow but nevermind. |
I renamed my made-up AA into IMG, like in https://tickets.metabrainz.org/projects/IMG |
/deploy-preview Looks good to me. I will give @ROpdebee a chance to react before I will merge, though.
Your terminal does not support the Alternatively you can also run |
feat(caa dims): add support for new event art archive (EAA) (#779)
- Revert unnecessary release group change ROpdebee#779 (comment) - Use IMG (image archives https://tickets.metabrainz.org/projects/IMG) instead of AA (art archives) ROpdebee#779 (review)
2041f59
to
7ec78bd
Compare
I forced-pushed an amended commit that is preserving original constant order. I failed building again. $ npm run build-dev
> [email protected] build-dev
> tsx build/build.ts
Building mb_caa_dimensions
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:236:11)
at defaultLoad (node:internal/modules/esm/load:128:3)
at nextLoad (node:internal/modules/esm/hooks:865:28)
at Z (file:///C:/Users/▒▒▒▒▒▒▒/git/_forks/ROpdebee_mb-userscripts/node_modules/tsx/dist/esm/index.mjs:5:1650)
at nextLoad (node:internal/modules/esm/hooks:865:28)
at Hooks.load (node:internal/modules/esm/hooks:448:26)
at MessagePort.handleMessage (node:internal/modules/esm/worker:196:24)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:814:20)
at exports.emitMessage (node:internal/per_context/messageport:23:28) {
code: 'PLUGIN_ERROR',
pluginCode: 'ERR_UNSUPPORTED_ESM_URL_SCHEME',
plugin: 'UserscriptPlugin',
hook: 'transform',
id: '\x00virtual:index.js'
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not delay this feature further, it is definitely good enough for the initial release.
Code clean-up can be done later (or not).
Apply eslint unreadable unicorn/prefer-regexp-test preference To pass the tests in #779
feat(caa dims): add support for new event art archive (EAA) (#779)
🚀 Released 1 new userscript version(s):
|
Which code cleanup? |
Oh, maybe cleanup wasn't the best term, what I meant is rather renaming/rewording. |
Ah OK! I forgot about that. :) |
@vzell request:
Tested on https://musicbrainz.org/event/d1bd6d40-55f6-4e1a-91df-4c9395f95401 and sub-pages (/event-art, /edits)