style: auto-fix linting issues
This commit is contained in:
parent
1cac6d249b
commit
5663b841c9
2 changed files with 63 additions and 23 deletions
52
index.html
52
index.html
|
|
@ -570,29 +570,61 @@
|
||||||
<p style="margin-bottom: 0.5rem; font-size: 0.9rem">Import from CSV</p>
|
<p style="margin-bottom: 0.5rem; font-size: 0.9rem">Import from CSV</p>
|
||||||
|
|
||||||
<div style="display: flex; gap: 0.5rem; margin-bottom: 1rem">
|
<div style="display: flex; gap: 0.5rem; margin-bottom: 1rem">
|
||||||
<button type="button" id="csv-spotify-btn" class="btn-secondary" style="flex: 1; opacity: 0.7">Spotify</button>
|
<button
|
||||||
<button type="button" id="csv-apple-btn" class="btn-secondary" style="flex: 1; opacity: 0.7">Apple Music</button>
|
type="button"
|
||||||
<button type="button" id="csv-ytm-btn" class="btn-secondary" style="flex: 1; opacity: 0.7">YouTube Music</button>
|
id="csv-spotify-btn"
|
||||||
|
class="btn-secondary"
|
||||||
|
style="flex: 1; opacity: 0.7"
|
||||||
|
>
|
||||||
|
Spotify
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
id="csv-apple-btn"
|
||||||
|
class="btn-secondary"
|
||||||
|
style="flex: 1; opacity: 0.7"
|
||||||
|
>
|
||||||
|
Apple Music
|
||||||
|
</button>
|
||||||
|
<button type="button" id="csv-ytm-btn" class="btn-secondary" style="flex: 1; opacity: 0.7">
|
||||||
|
YouTube Music
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="csv-spotify-guide" style="display: none; margin-bottom: 1rem">
|
<div id="csv-spotify-guide" style="display: none; margin-bottom: 1rem">
|
||||||
<p style="font-size: 0.8rem; margin: 0">
|
<p style="font-size: 0.8rem; margin: 0">
|
||||||
Please use <a href="https://exportify.app/" target="_blank" style="text-decoration: underline">Exportify</a> to export your Spotify playlist into a .csv.
|
Please use
|
||||||
|
<a href="https://exportify.app/" target="_blank" style="text-decoration: underline"
|
||||||
|
>Exportify</a
|
||||||
|
>
|
||||||
|
to export your Spotify playlist into a .csv.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="csv-apple-guide" style="display: none; margin-bottom: 1rem">
|
<div id="csv-apple-guide" style="display: none; margin-bottom: 1rem">
|
||||||
<p style="font-size: 0.8rem; margin: 0">
|
<p style="font-size: 0.8rem; margin: 0">
|
||||||
Please use <a href="https://www.tunemymusic.com/transfer/spotify-to-apple-music" target="_blank" style="text-decoration: underline">TuneMyMusic</a> to export your Apple Music playlist into a .csv.
|
Please use
|
||||||
<br><span style="opacity: 0.7">(Apple Music imports are prone to errors)</span>
|
<a
|
||||||
|
href="https://www.tunemymusic.com/transfer/spotify-to-apple-music"
|
||||||
|
target="_blank"
|
||||||
|
style="text-decoration: underline"
|
||||||
|
>TuneMyMusic</a
|
||||||
|
>
|
||||||
|
to export your Apple Music playlist into a .csv. <br /><span style="opacity: 0.7"
|
||||||
|
>(Apple Music imports are prone to errors)</span
|
||||||
|
>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="csv-ytm-guide" style="display: none; margin-bottom: 1rem">
|
<div id="csv-ytm-guide" style="display: none; margin-bottom: 1rem">
|
||||||
<p style="font-size: 0.8rem; margin: 0 0 0.5rem 0">
|
<p style="font-size: 0.8rem; margin: 0 0 0.5rem 0">Paste a YouTube Music Playlist URL.</p>
|
||||||
Paste a YouTube Music Playlist URL.
|
<input
|
||||||
</p>
|
type="text"
|
||||||
<input type="text" id="ytm-url-input" class="template-input" placeholder="https://music.youtube.com/playlist?list=..." style="width: 100%; margin-bottom: 0.5rem">
|
id="ytm-url-input"
|
||||||
|
class="template-input"
|
||||||
|
placeholder="https://music.youtube.com/playlist?list=..."
|
||||||
|
style="width: 100%; margin-bottom: 0.5rem"
|
||||||
|
/>
|
||||||
<p id="ytm-status" style="font-size: 0.8rem; margin: 0; opacity: 0.7"></p>
|
<p id="ytm-status" style="font-size: 0.8rem; margin: 0; opacity: 0.7"></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
20
js/app.js
20
js/app.js
|
|
@ -1104,10 +1104,15 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||||
|
|
||||||
currentTrackElement.textContent = `Processing ${songs.length} songs...`;
|
currentTrackElement.textContent = `Processing ${songs.length} songs...`;
|
||||||
|
|
||||||
const headers = "Title,Artist,URL\n";
|
const headers = 'Title,Artist,URL\n';
|
||||||
const csvText = headers + songs.map(s =>
|
const csvText =
|
||||||
|
headers +
|
||||||
|
songs
|
||||||
|
.map(
|
||||||
|
(s) =>
|
||||||
`"${s.title.replace(/"/g, '""')}","${s.artist.replace(/"/g, '""')}","${s.url}"`
|
`"${s.title.replace(/"/g, '""')}","${s.artist.replace(/"/g, '""')}","${s.url}"`
|
||||||
).join("\n");
|
)
|
||||||
|
.join('\n');
|
||||||
|
|
||||||
const totalTracks = songs.length;
|
const totalTracks = songs.length;
|
||||||
progressTotal.textContent = totalTracks.toString();
|
progressTotal.textContent = totalTracks.toString();
|
||||||
|
|
@ -2291,10 +2296,13 @@ function showMissingTracksNotification(missingTracks) {
|
||||||
const modal = document.getElementById('missing-tracks-modal');
|
const modal = document.getElementById('missing-tracks-modal');
|
||||||
const listUl = document.getElementById('missing-tracks-list-ul');
|
const listUl = document.getElementById('missing-tracks-list-ul');
|
||||||
|
|
||||||
listUl.innerHTML = missingTracks.map((track) => {
|
listUl.innerHTML = missingTracks
|
||||||
const text = typeof track === 'string' ? track : `${track.artist ? track.artist + ' - ' : ''}${track.title}`;
|
.map((track) => {
|
||||||
|
const text =
|
||||||
|
typeof track === 'string' ? track : `${track.artist ? track.artist + ' - ' : ''}${track.title}`;
|
||||||
return `<li>${text}</li>`;
|
return `<li>${text}</li>`;
|
||||||
}).join('');
|
})
|
||||||
|
.join('');
|
||||||
|
|
||||||
const closeModal = () => modal.classList.remove('active');
|
const closeModal = () => modal.classList.remove('active');
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue