konami-command icon indicating copy to clipboard operation
konami-command copied to clipboard

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

Open kellnerd opened this issue 1 year ago • 7 comments

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.

kellnerd avatar Jan 26 '24 11:01 kellnerd

I made an attempt: https://github.com/jesus2099/konami-command/commit/24cf11e84f116301db1fe9d3a47d2ee2b993876d

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 avatar Jan 27 '24 00:01 jesus2099

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.

jesus2099 avatar Jan 27 '24 00:01 jesus2099

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: https://github.com/kellnerd/musicbrainz-scripts/compare/main...recording-dates The most complex and important stuff is in https://github.com/kellnerd/musicbrainz-scripts/commit/0e46814ff8a7a45189769b7a375d0e976a686134

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.

kellnerd avatar Jan 27 '24 16:01 kellnerd

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.

jesus2099 avatar Jan 29 '24 22:01 jesus2099

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.

kellnerd avatar Jan 30 '24 12:01 kellnerd