mirror of
https://notabug.org/SuperSaltyGamer/ame
synced 2026-01-15 16:22:56 -03:00
[musicbrainz] Source for "fix log text pasting"
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// ==UserScript==
|
||||
// @namespace ame-musicbrainz
|
||||
// @name Ame (MusicBrainz)
|
||||
// @version 1.6.1
|
||||
// @version 1.6.2
|
||||
// @author SuperSaltyGamer
|
||||
// @run-at document-end
|
||||
// @match https://musicbrainz.org/*
|
||||
|
||||
@@ -28,6 +28,9 @@ typeEl.options.add(fromHTML<HTMLOptionElement>(`<option value="toc">CD TOC</opti
|
||||
typeEl.options.add(fromHTML<HTMLOptionElement>(`<option value="isrc">ISRC</option>`));
|
||||
|
||||
queryEl.addEventListener("input", () => {
|
||||
const toc = parseTocFromLog(queryEl.value);
|
||||
if (toc) queryEl.value = toc;
|
||||
|
||||
switch (identifyQuery(queryEl.value)) {
|
||||
case QueryType.Barcode:
|
||||
typeEl.value = "barcode";
|
||||
@@ -60,10 +63,8 @@ formEl.addEventListener("drop", async e => {
|
||||
const reader = new FileReader();
|
||||
reader.readAsText(file);
|
||||
reader.onload = () => {
|
||||
const toc = parseTocFromLog(reader.result as string);
|
||||
if (!toc) return;
|
||||
queryEl.value = toc;
|
||||
typeEl.value = "toc";
|
||||
queryEl.value = reader.result as string;
|
||||
queryEl.dispatchEvent(new Event("input"));
|
||||
submitEl.click();
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user