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:
David Kellner 2021-10-17 16:23:55 +02:00
parent 2531d25157
commit 17be011a33

View file

@ -22,8 +22,9 @@ $(document).ready(function () {
});
async function parsePage() {
const releaseId = window.location.hash.match(/#\/album\/(.+)/)?.[1];
if (!releaseId) return; // SPA currently shows a different type of page
const releaseMatch = window.location.hash.match(/#\/album\/(.+)/);
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"
if (document.getElementById(`mb-import-ui-${releaseId}`)) return;
@ -84,7 +85,7 @@ function insertButtons(release, releaseUrl) {
.on('click', () => {
const allTracks = release.discs.map(disc => disc.tracks).flat();
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);