y-young / userscripts

A collection of self-made userscripts.
MIT License
8 stars 3 forks source link

Adding support for separation using special characters #6

Closed Roshri closed 2 years ago

Roshri commented 2 years ago

Hi! I really love your script as it really speeds up my proccess of importing releases to MB I was wondering if some special characters could be added, or where should I modify the script myself.

I was reading through it and I understand the following characters are supported but I couldn't make it work ,、 when I add some artists separated with these, the "Parse Artist Credits" does not separate them. If it's possible to fix this, I'd like to also add support for the character since I'm finding it a lot on some releases

Once again, thank you for this cool script

y-young commented 2 years ago

I was reading through it and I understand the following characters are supported but I couldn't make it work ,、 when I add some artists separated with these, the "Parse Artist Credits" does not separate them.

They'll work if preceded by a ')', like (CV.ABC)、, but it seems I forgot they could be used independently, will fix it later.

If it's possible to fix this, I'd like to also add support for the character since I'm finding it a lot on some releases

Sure, simply change JOIN_PHRASE_PATTERN to \s*(?:\(CV[\.:: ]?|\)[,,、]?|\s(?:featuring|feat|ft|vs)[\.\s]|,|、|,|&|・)\s* (this also fixes the first one). ~It'd be better if you can provide some examples how it's used.~ Never mind, I saw it on https://musicbrainz.org/release/a07ee0b7-e943-4a13-8fda-25bf2135574a.

Please tell me if it's working correctly after you tried it.

Roshri commented 2 years ago

Yup, that was the very same release I added today and sparked this issue!

Just gave it a try and it seems to work flawlessly now!

image

y-young commented 2 years ago

I didn't know '・' can be used with 'CV', I'm trying to figure out how to make it work.

y-young commented 2 years ago

I think I've figured it out, try \s*(?:\(CV[\.:: ]?|\)\s*[,,、・]?|\s(?:featuring|feat|ft|vs)[\.\s]|,|,|、|&|・)\s*.

Roshri commented 2 years ago

Adding a dummy release with a similar format and it looks like this when trying it out now

image

I think it works as intended now! Thanks!