murdos / musicbrainz-userscripts

Collection of userscripts for MusicBrainz, by various authors
541 stars 91 forks source link

Show warning before edit comments on recordings used on other releases. #432

Closed mattgoldspink closed 2 years ago

mattgoldspink commented 2 years ago

The key changes are:

Animated Preview: image

In addition I moved the setInterval call to be after the check for the pathname, otherwise we end up making a lot of unnecessary API requests which we won't be able to act upon.

I also changed to use the fetch api because $.get error handling is currently broken by the Sentry upgrade in MB.

kellnerd commented 2 years ago

@mattgoldspink Do you know the MB: QoL: Inline all recording's tracks on releases userscript? I am asking because your current approach of making an API call for every recording of the release is very inefficient while e.g. the linked userscript uses a combined API call to fetch multiple recordings at once.

I would even go so far as to say that in most situations it is not even relevant to know whether the recording is used on multiple releases (because often they are in the same RG and the comment should apply to all of them), rather on which releases/RGs they are used. And in my opinion it is the responsibility of the user to ensure they are editing the correct recordings and the linked userscript is very helpful in these (and many other) situations.

mattgoldspink commented 2 years ago

No I hadn't - thanks for sharing!

The use case I had for this is that I'm in the process of tidying up a lot of recordings that have come vinyl. A lot are incorrectly marked as being used on a DJ-mix and a lot of them should be marked as such but aren't. They're in such a mess that when I come to add a recording comment, it's been helpful to see if there any that have been incorrectly associated with none DJ-mix. Clicking through each track in a big mix was a slow process, but it sounds like this other use script may be exactly what I need!

mattgoldspink commented 2 years ago

Just tried it - it's perfect! Much better than what I had :) Thanks! Feel free to close this if you don't think it'll be useful.

kellnerd commented 2 years ago

You are welcome. I'm only a contributor here, just like you, I don't have the power to merge or close PRs :) If you don't want to close this PR yourself yet, you could also wait for other opinions and let @murdos (or one of the collaborators) decide.

jesus2099 commented 2 years ago

Sorry @mattgoldspink it's because of me that you created this PR. 🙇

I didn't know that @ROpdebee QoL script.

mattgoldspink commented 2 years ago

Not a problem at all @jesus2099! @ROpdebee's script is much better and I also discovered his one to seed DJ-mix comments, which was my original goal! So it's saved me a huge amount of time :)