update TODO; fix typo

This commit is contained in:
XenGi 2024-04-06 19:27:59 +02:00
parent 03677e24be
commit 899dde0754
Signed by: xengi
SSH key fingerprint: SHA256:jxWM2RTHvxxcncXycwwWkP7HCWb4VREN05UGJTbIPZg
2 changed files with 26 additions and 30 deletions

View file

@ -152,12 +152,12 @@ control_delete_playlist.addEventListener("click", () => {
});
});
control_update_db.addEventListener("click", () => {
control_update_db.addEventListener("click", event => {
console.log("Issuing database update")
fetch(`${API_URL}/update_db`).then(async r => {
if (r.status === 200) {
console.log(await r.text());
e.target.disabled = true;
event.target.disabled = true;
} else {
console.error(`API returned ${r.status}: ${r.statusText}`);
}
@ -420,32 +420,28 @@ socket.addEventListener("message", event => {
const length = document.createElement("td");
length.innerText = secondsToTrackTime(song.duration);
const actions = document.createElement("td");
const moveUp = document.createElement("button");
moveUp.classList.add("borderless");
if (parseInt(song.Pos) !== 0) {
const moveUp = document.createElement("button");
moveUp.classList.add("borderless");
moveUp.innerHTML = "🔺"; // 🔺 Red Triangle Pointed Down
moveUp.addEventListener("click", event => { moveTrackInQueue(event, -1) });
actions.appendChild(moveUp);
} else {
const spacer = document.createElement("span")
spacer.innerHTML = " ";
actions.appendChild(spacer);
moveUp.innerHTML = " ";
}
const moveDown = document.createElement("button");
moveDown.classList.add("borderless");
if (parseInt(song.Pos) !== msg.mpd_queue.length - 1) {
const moveDown = document.createElement("button");
moveDown.classList.add("borderless");
moveDown.innerHTML = "🔻"; // 🔻 Red Triangle Pointed Up
moveDown.addEventListener("click", event => {moveTrackInQueue(event, 1)});
actions.appendChild(moveDown);
} else {
const spacer = document.createElement("span")
spacer.innerHTML = " ";
actions.appendChild(spacer);
moveDown.innerHTML = " ";
}
const remove = document.createElement("button");
remove.classList.add("borderless");
remove.innerHTML = "❌"; // ❌ Cross mark
remove.addEventListener("click", removeTrackFromQueue);
actions.appendChild(moveUp);
actions.appendChild(moveDown);
actions.appendChild(remove);
tr.appendChild(pos);
tr.appendChild(artist);