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

MASS SET WORKS’ RECORDING DATES broken with the new relationship editor #807

Open
kellnerd opened this issue Jan 26, 2024 · 7 comments
Open

Comments

@kellnerd
Copy link
Contributor

The selector for the checkboxes has changed and MB.relationshipEditor.UI.checkedWorks() no longer exists. I am trying to implement this feature with the new exposed functions.

@jesus2099
Copy link
Owner

jesus2099 commented Jan 27, 2024

I made an attempt: 24cf11e

But it does not work:

  • You have to select recordings
    (it is more straightforward than selecting works, which is also possible but I skipped that for the moment)
  • On some recordings, it fails
    (this could be fixed but the worst is next point)
  • It does change the JavaScript begin_date and end_date values but the display does not updates
    (click the pencil and press Escape to force display update)

@jesus2099
Copy link
Owner

It seems that I have to convert this feature to old school userscript where have to simulate user interactions: click pencil, focus inputs, type in inputs, press Enter.

@kellnerd
Copy link
Contributor Author

I've tried to implement this yesterday, but didn't get it to do anything besides MBS trying to report an error to sentry 🤯
Today I've found a few things which I was missing when I created the necessary relationship state object and managed to create a working bookmarklet 🎉
It is currently in a separate branch: kellnerd/musicbrainz-scripts@main...recording-dates
The most complex and important stuff is in kellnerd/musicbrainz-scripts@0e46814

Without my copies of the MBS type definitions it would have been a pain to find out which properties are expected by the exposed methods. It expects the properties of the existing relationship to be passed three times currently... maybe I should ask bitmap if this is really necessary.

@jesus2099
Copy link
Owner

Hi @kellnerd,
Do you have a working userscript with this feature fixed?
Please link it.
I will try it and most probably drop my feature in favour of your script.

@kellnerd
Copy link
Contributor Author

There is only the bookmarklet version so far as I haven't thought about the UI to expose it yet.
Currently the code only modifies relationships which were already existing when the editor was opened, but it should be possible to also modify new relationships and take changes into account which were made during the current editing session. I will try to support that as well.

@jesus2099
Copy link
Owner

MBS trying to report an error to sentry 🤯

How do you know when this happens?
I may also often produce these remote logs, probably!

@kellnerd
Copy link
Contributor Author

I see the sentry requests in the browser console. But uBlock Origin blocks sentry requests by default, so I don't spam MBS with confusing errors while developing.

Only sometimes when I have no idea why one of my scripts is not working, I allow these sentry requests to go through. This seems to be necessary to be able to inspect their body with the error details in the browser console.

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

No branches or pull requests

2 participants