diff --git a/app/static/app.js b/app/static/app.js index 75477c1..4a276dc 100644 --- a/app/static/app.js +++ b/app/static/app.js @@ -19,7 +19,7 @@ document.addEventListener("DOMContentLoaded", () => { if (!url) return; try { - const res = await fetch("/api/download", { + const res = await fetch("api/download", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ url }) @@ -40,7 +40,7 @@ document.addEventListener("DOMContentLoaded", () => { syncLikesBtn.addEventListener("click", async () => { if (!confirm("Запустить синхронизацию плейлиста «Мне нравится» из Яндекс Музыки?")) return; try { - const res = await fetch("/api/sync/yandex-likes", { method: "POST" }); + const res = await fetch("api/sync/yandex-likes", { method: "POST" }); const data = await res.json(); if (data.task_id) { fetchTasks(); @@ -52,7 +52,7 @@ document.addEventListener("DOMContentLoaded", () => { async function fetchTasks() { try { - const res = await fetch("/api/tasks"); + const res = await fetch("api/tasks"); const tasks = await res.json(); renderTasks(tasks); } catch (err) { @@ -87,7 +87,7 @@ document.addEventListener("DOMContentLoaded", () => { async function fetchHistory() { try { - const res = await fetch("/api/history"); + const res = await fetch("api/history"); const data = await res.json(); if (tracksCount) tracksCount.textContent = `Загружено: ${data.total || 0}`; renderHistory(data.tracks || []); diff --git a/app/templates/index.html b/app/templates/index.html index 686f5a7..dcd9657 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -4,7 +4,7 @@ Navidrome Music Sync - + @@ -83,6 +83,6 @@ - +