musicbrainz-scripts icon indicating copy to clipboard operation
musicbrainz-scripts copied to clipboard

feat: Add Harmony release action links to MusicBrainz pages

Open Dr-Blank opened this issue 10 months ago • 4 comments

This userscript adds a convenient link to the Harmony website directly from MusicBrainz pages, making it easier to jump to Harmony's release-specific actions.

Motivation:

Currently, navigating from a MusicBrainz release to its corresponding Harmony actions page requires manually copying the MBID and constructing the URL. This script automates that process by adding a clickable icon.

Functionality:

  1. On single release pages, the icon is placed in the main page header next to the release title.

  2. On release group and artist releases pages, icons are added next to each release listed in the main table.

  3. Clicking any icon opens the corresponding Harmony release actions URL (https://harmony.pulsewidth.org.uk/release/actions?release_mbid=...) in a new browser tab.

Dr-Blank avatar Apr 06 '25 18:04 Dr-Blank

should i add the built script to the PR?

Dr-Blank avatar Apr 06 '25 18:04 Dr-Blank

Hi, my time is limited currently, so I won't get to review this PR before the weekend.

However, I wanted to let you know early that there is already another userscript which does a similar task. From a brief look, it seems that your script supports more MB pages, so it might be worth trying to integrate this into the other userscript, if it fits there.

kellnerd avatar Apr 08 '25 11:04 kellnerd

Thanks for letting me know! No worries at all—take your time reviewing the PR, I understand you have other priorities.

I hadn’t realized there was another userscript doing something similar. My intent was just to convert your bookmarklet into a script and extend it to more MB pages. I’d prefer to keep it here since the project structure is well-organized with the build scripts, and I’ve reused some of your functions to avoid duplication. Also, since I’ve already put together the PR, integrating it into the other userscript would require reworking things a bit due to the different approaches.

I also think that in the long run, having a centralized place for MusicBrainz userscripts, rather than everyone maintaining separate repositories, would make things easier to manage and discover. But of course, I’m open to discussion if you feel otherwise! Let me know your thoughts when you have time.

Dr-Blank avatar Apr 09 '25 06:04 Dr-Blank

Thanks for taking the time to build, test, and provide feedback on the userscript! I really appreciate it.

I understand your point about the icons on artist/RG pages potentially being less frequently used after an initial pass. To address it I have added a key value to later turn it off. I'm happy to maintain the script as I use it, also as it might still be useful for users who frequently interact with Harmony or revisit those pages. If maintenance becomes an issue down the line, we can definitely reassess.

Regarding your specific feedback on the script itself:

  1. Icon Placement: I've updated the script to inject the Harmony icon after the release title/link on all page types (release header, RG table, artist releases table). I agree this feels cleaner as a secondary action.
  2. Styling: I've removed all inline style attributes. The icon link and the icon image now use CSS classes (harmony-userscript-link and harmony-userscript-icon). The necessary styles (including size and margin) are dynamically generated based on configuration and injected into the page's <head> via a <style> tag.
  3. Configuration: The configurable values (icon size and left margin, plus to turn off on RG/Artist pages) are now stored and retrieved using GM_getValue and GM_setValue. Users can modify these directly in their userscript manager's storage tab if they want to tweak the appearance. Default values are applied if nothing is set.

I've pushed these changes. Let me know what you think!

Thanks again for the review and guidance.

Dr-Blank avatar Apr 21 '25 19:04 Dr-Blank

sorry for the late reply

I have applied your suggestions as well as added logic to get format column from instead of hard coding the value.

It works with the userscript you linked. However it worked without the patch as well! I think it must be because my script ran before the other one could add a new column, and hence i could not test my scripts failure before this patch. Regardless, it should now work with the new patch with any number of columns being added/removed.

Dr-Blank avatar May 13 '25 06:05 Dr-Blank