v0.1.1 - debug

This commit is contained in:
Xmader 2019-11-03 15:01:29 -05:00
parent 138dedae65
commit 3c667fcdfb
4 changed files with 18 additions and 9 deletions

6
dist/main.js vendored
View file

@ -3,7 +3,7 @@
// @namespace https://www.xmader.com/
// @homepageURL https://github.com/Xmader/musescore-downloader/
// @supportURL https://github.com/Xmader/musescore-downloader/issues
// @version 0.1.0
// @version 0.1.1
// @description 免登录、免 Musescore Pro下载 musescore.com 上的曲谱
// @author Xmader
// @match https://musescore.com/user/*/scores/*
@ -28,7 +28,7 @@
const { id, vid } = scorePlayer.json;
const baseURL = scorePlayer.urls.image_path;
const scoreHexId = baseURL.split("/").filter(Boolean).reverse()[1];
const msczURL = `https://musescore.com/static/musescore/scoredata/score/${getIndexPath}/${id}/score_${vid}_${scoreHexId}.mscz`;
const msczURL = `https://musescore.com/static/musescore/scoredata/score/${getIndexPath(id)}/${id}/score_${vid}_${scoreHexId}.mscz`;
const pdfURL = baseURL + "score_full.pdf";
const mxlURL = baseURL + "score.mxl";
const { midi: midiURL, mp3: mp3URL } = scorePlayer.urls;
@ -48,6 +48,8 @@
btn.onclick = () => {
window.open(url);
};
const span = downloadBtn.querySelector("span");
span.textContent = `Download ${name}`;
return btn;
});
downloadBtn.replaceWith(...newDownloadBtns);

View file

@ -1,6 +1,6 @@
{
"name": "musescore-downloader",
"version": "0.1.0",
"version": "0.1.1",
"description": "免登录、免 Musescore Pro下载 musescore.com 上的曲谱",
"main": "dist/main.js",
"repository": {

View file

@ -1,17 +1,21 @@
import typescript from "rollup-plugin-typescript"
import fs from "fs"
import { version } from "./package.json"
let bannerText = fs.readFileSync("./src/meta.js", "utf-8")
bannerText = bannerText.replace("%VERSION%", version)
const getBannerText = () => {
const packageJson = JSON.parse(fs.readFileSync("./package.json", "utf-8"))
const { version } = packageJson
let bannerText = fs.readFileSync("./src/meta.js", "utf-8")
bannerText = bannerText.replace("%VERSION%", version)
return bannerText
}
export default {
input: "src/main.ts",
output: {
file: "dist/main.js",
format: "iife",
banner: bannerText,
sourcemap: false,
banner: getBannerText,
},
plugins: [
typescript({
@ -21,6 +25,6 @@ export default {
"ES6",
"dom"
],
})
}),
]
}

View file

@ -10,7 +10,7 @@ const { id, vid } = scorePlayer.json
const baseURL = scorePlayer.urls.image_path
const scoreHexId = baseURL.split("/").filter(Boolean).reverse()[1]
const msczURL = `https://musescore.com/static/musescore/scoredata/score/${getIndexPath}/${id}/score_${vid}_${scoreHexId}.mscz`
const msczURL = `https://musescore.com/static/musescore/scoredata/score/${getIndexPath(id)}/${id}/score_${vid}_${scoreHexId}.mscz`
const pdfURL = baseURL + "score_full.pdf"
const mxlURL = baseURL + "score.mxl"
const { midi: midiURL, mp3: mp3URL } = scorePlayer.urls
@ -35,6 +35,9 @@ const newDownloadBtns = Object.keys(downloadURLs).map((name) => {
window.open(url)
}
const span = downloadBtn.querySelector("span")
span.textContent = `Download ${name}`
return btn
})