From af8a5f4945dad9eae474453aa1c8aea1d3bf7bb8 Mon Sep 17 00:00:00 2001 From: Adam James Date: Fri, 29 Mar 2024 00:10:20 +0100 Subject: [PATCH] beatport_importer: Display barcode in release info (#558) --- beatport_importer.user.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/beatport_importer.user.js b/beatport_importer.user.js index 4c486b4..328240f 100644 --- a/beatport_importer.user.js +++ b/beatport_importer.user.js @@ -3,7 +3,7 @@ // @author VxJasonxV // @namespace https://github.com/murdos/musicbrainz-userscripts/ // @description One-click importing of releases from beatport.com/release pages into MusicBrainz -// @version 2023.10.22.1 +// @version 2024.03.28.1 // @downloadURL https://raw.githubusercontent.com/murdos/musicbrainz-userscripts/master/beatport_importer.user.js // @updateURL https://raw.githubusercontent.com/murdos/musicbrainz-userscripts/master/beatport_importer.user.js // @include http://www.beatport.com/release/* @@ -153,5 +153,21 @@ function insertLink(mbrelease, release_url, isrcs) { $('form.musicbrainz_import').css({ display: 'inline-block', 'margin-left': '5px' }); $('form.musicbrainz_import button').css({ width: '120px' }); $('form.musicbrainz_import button img').css({ display: 'inline-block' }); + + const lastReleaseInfo = $('div[class^="ReleaseDetailCard-style__Info"]').last(); + const spanHTML = mbrelease.barcode + ? ` + ${mbrelease.barcode} + ` + : '[none]'; + const releaseInfoBarcode = $( + `
+

Barcode

+ ${spanHTML} +
` + ).hide(); + lastReleaseInfo.after(releaseInfoBarcode); + mbUI.slideDown(); + releaseInfoBarcode.slideDown(); }