mirror of
https://github.com/murdos/musicbrainz-userscripts
synced 2024-12-13 20:02:27 +00:00
hdtracks: Fix ESLint errors
Forgo optional chaining which is an ES2020 feature. It feels odd to raise the ES version even further for such a minor improvement.
This commit is contained in:
parent
2531d25157
commit
17be011a33
1 changed files with 4 additions and 3 deletions
|
@ -22,8 +22,9 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
async function parsePage() {
|
async function parsePage() {
|
||||||
const releaseId = window.location.hash.match(/#\/album\/(.+)/)?.[1];
|
const releaseMatch = window.location.hash.match(/#\/album\/(.+)/);
|
||||||
if (!releaseId) return; // SPA currently shows a different type of page
|
if (!releaseMatch) return; // SPA currently shows a different type of page
|
||||||
|
const releaseId = releaseMatch[1];
|
||||||
|
|
||||||
// our buttons might already be there since the SPA caches the previous page for "also available in"
|
// our buttons might already be there since the SPA caches the previous page for "also available in"
|
||||||
if (document.getElementById(`mb-import-ui-${releaseId}`)) return;
|
if (document.getElementById(`mb-import-ui-${releaseId}`)) return;
|
||||||
|
@ -84,7 +85,7 @@ function insertButtons(release, releaseUrl) {
|
||||||
.on('click', () => {
|
.on('click', () => {
|
||||||
const allTracks = release.discs.map(disc => disc.tracks).flat();
|
const allTracks = release.discs.map(disc => disc.tracks).flat();
|
||||||
const query = allTracks.map(track => `isrc${track.number}=${track.isrc}`).join('&');
|
const query = allTracks.map(track => `isrc${track.number}=${track.isrc}`).join('&');
|
||||||
window.open('https://magicisrc.kepstin.ca?' + query);
|
window.open(`https://magicisrc.kepstin.ca?${query}`);
|
||||||
})
|
})
|
||||||
.appendTo(importerUI);
|
.appendTo(importerUI);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue