Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions discogs_importer.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// @name Import Discogs releases to MusicBrainz
// @description Add a button to import Discogs releases to MusicBrainz and add links to matching MusicBrainz entities for various Discogs entities (artist,release,master,label)
// @version 2025.08.13
// @version 2026.01.28
// @namespace http://userscripts.org/users/22504
// @downloadURL https://raw.githubusercontent.com/murdos/musicbrainz-userscripts/master/discogs_importer.user.js
// @updateURL https://raw.githubusercontent.com/murdos/musicbrainz-userscripts/master/discogs_importer.user.js
Expand Down Expand Up @@ -406,11 +406,27 @@

function insertMbUI(mbUI) {
let e;
if ((e = $('#release-marketplace')) && e.length) {

// New Discogs layout (works on your saved page)
if ((e = $('#release-actions')) && e.length) {
e.before(mbUI);
return;
}
if ((e = $('#release-stats')) && e.length) {
e.before(mbUI);
return;
}
// FIXME: the following selectors are broken since the 2021-08-09 release page update, not sure why there are three alternative selectors
else if ((e = $('div.section.collections')) && e.length) {

// Fallback: stick it near the top of the sidebar if we can find it
if ((e = $('div.side__gnpk').first()) && e.length) {
e.before(mbUI);
return;
}

// Old layout fallbacks (keep these just in case)
if ((e = $('#release-marketplace')) && e.length) {
e.before(mbUI);
} else if ((e = $('div.section.collections')) && e.length) {
e.after(mbUI);
} else if ((e = $('#statistics')) && e.length) {
e.before(mbUI);
Expand All @@ -419,6 +435,7 @@
}
}


Check failure on line 438 in discogs_importer.user.js

View workflow job for this annotation

GitHub Actions / lint checks

Delete `⏎`
// Insert links in Discogs page
function insertMBSection(release, current_page_key) {
const current_page_info = link_infos[current_page_key];
Expand Down
Loading