Discogs ~ Website Clientside Scripting


Automatically sorting Discogs master release pages by country:

  1. First download and install Tampermonkey from https://tampermonkey.net/
  2. Once it’s installed, open the extension menu and click “Create new script”
  3. Paste the Javascript code below into the editor and click File > Save

(replace everything that’s there with this code)

// ==UserScript==
// @name         Discogs Master Release Default Sort By Country
// @namespace    https://www.discogs-enhancer.com
// @version      0.1
// @description  Set MR release link to include custom filters by default
// @author       Matthew Salcido (discogs.enhancer@gmail.com)
// @match        https://www.discogs.com/*
// @grant        none
// ==/UserScript==
(function() {
    'use strict';
    const links = [...document.querySelectorAll('a')];
    links.forEach(link => {
        if (link.href.includes('/master/')) {
         link.href += '?sort=country&sort_order=';
        }
    });
})();

Leave A Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.