Update everything

This commit is contained in:
SuperSaltyGamer
2023-07-21 00:35:51 +03:00
parent 1d1fe04bb6
commit ce122b22e6
4 changed files with 48 additions and 8 deletions

View File

@@ -7,6 +7,7 @@ Various userscripts for the music hoarding community.
Install [ViolentMonkey](https://violentmonkey.github.io) or [TamperMonkey](https://tampermonkey.net) then proceed to installing any of the following userscripts:
* [Apple Music](https://notabug.org/SuperSaltyGamer/ame/raw/main/dist/applemusic.user.js)
* [MusicBrainz](https://notabug.org/SuperSaltyGamer/ame/raw/main/dist/musicbrainz.user.js)
* [VGMdb](https://notabug.org/SuperSaltyGamer/ame/raw/main/dist/vgmdb.user.js)
### References

File diff suppressed because one or more lines are too long

15
dist/musicbrainz.user.js vendored Normal file
View File

@@ -0,0 +1,15 @@
// ==UserScript==
// @namespace ame-musicbrainz
// @name Ame (MusicBrainz)
// @version 1.0.0
// @author SuperSaltyGamer
// @run-at document-end
// @match https://musicbrainz.org/*
// @match https://beta.musicbrainz.org/*
// @grant GM.addStyle
// @grant GM.xmlHttpRequest
// @downloadURL https://notabug.org/SuperSaltyGamer/ame/raw/main/dist/musicbrainz.user.js
// @updateURL https://notabug.org/SuperSaltyGamer/ame/raw/main/dist/musicbrainz.user.js
// ==/UserScript==
(function(n){typeof define=="function"&&define.amd?define(n):n()})(function(){"use strict";const n=/(\d+) +\| +([0-9:.]+) +\| +([0-9:.]+) +\| +(\d+) +\| +(\d+)/g,a=document.querySelector("form[action='/search']"),i=document.querySelector("#headerid-query");i.placeholder="Enhanced search",a.addEventListener("submit",e=>{const r=new FormData(a).get("query").trim(),t=s(r);if(t!=="other")switch(e.preventDefault(),t){case"catalog":const o=r.split("~")[0];location.href=`https://musicbrainz.org/search?type=release&method=advanced&query=catno:${encodeURIComponent(o)}`;break;case"barcode":location.href=`https://musicbrainz.org/search?type=release&method=advanced&query=barcode:${encodeURIComponent(r)}`;break;case"isrc":location.href=`https://musicbrainz.org/search?type=recording&method=advanced&query=isrc:${encodeURIComponent(r)}`;break;case"log-eac":case"log-xld":location.href=`https://musicbrainz.org/cdtoc/attach?toc=${d(r)}`;break}});function s(e){return e.match(/^(\d{8}|\d{12}|\d{13}|\d{14})$/i)?"barcode":e.match(/^[a-z]{5}[0-9]{7}$/i)?"isrc":e===e.toUpperCase()&&e.match(/\d/i)&&e.match(/[a-z]/i)&&e.match(/[ ~-]/i)?"catalog":e.includes("TOC of the extracted CD")&&e.includes("EAC extraction logfile")?"log-eac":e.includes("TOC of the extracted CD")&&e.includes("XLD extraction logfile")?"log-xld":"other"}function d(e){const c=[];let r=0;for(const t of e.matchAll(n)){const o=Number(t[1]);if(r>o)break;r=o,c.push({no:o,start:t[2],length:t[3],startSector:Number(t[4]),endSector:Number(t[5])})}return[1,c.length,c[c.length-1].endSector+150+1].concat(c.map(t=>t.startSector+150)).join("%20")}const h="";GM.addStyle(h)});

36
dist/vgmdb.user.js vendored

File diff suppressed because one or more lines are too long