bandcamp_importer: Seed BC URL to Harmony instead of UPC

This makes more sense because Harmony also supports Bandcamp lookups,
but only by URL and not by UPC.
With the extracted UPC, the user can optionally query other sources.

Also bump the version and make the linter happy.
This commit is contained in:
David Kellner 2024-09-06 21:46:31 +02:00
parent b9e706db0e
commit e801047823

View file

@ -1,7 +1,7 @@
// ==UserScript==
// @name Import Bandcamp releases to MusicBrainz
// @description Add a button on Bandcamp's album pages to open MusicBrainz release editor with pre-filled data for the selected release
// @version 2022.5.6.1
// @version 2024.9.6.1
// @namespace http://userscripts.org/users/22504
// @downloadURL https://raw.github.com/murdos/musicbrainz-userscripts/master/bandcamp_importer.user.js
// @updateURL https://raw.github.com/murdos/musicbrainz-userscripts/master/bandcamp_importer.user.js
@ -405,12 +405,11 @@ $(document).ready(function () {
bci_link.querySelector('a').style.fontWeight = 'bold';
const upc = unsafeWindow.TralbumData.current.upc;
if (typeof upc != 'undefined' && upc !== null) {
document
.querySelector('div #trackInfoInner')
.insertAdjacentHTML(
document.querySelector('div #trackInfoInner').insertAdjacentHTML(
'beforeend',
`<div id="mbaimport_upc" style="margin-bottom: 2em; font-size: smaller;"> UPC: ${upc}</br>
Import: <a href="https://harmony.pulsewidth.org.uk/release?url=&gtin=${upc}">Harmony</a> | <a href="https://atisket.pulsewidth.org.uk/?upc=${upc}">Atisket</a></div>`
`<div id="mbimport_upc" style="margin-bottom: 2em; font-size: smaller;">UPC: ${upc}<br/>
Import: <a href="https://harmony.pulsewidth.org.uk/release?url=${encodeURIComponent(release.url)}">Harmony</a>
| <a href="https://atisket.pulsewidth.org.uk/?upc=${upc}">a-tisket</a></div>`
);
}
});