From 9c92f4930f56a715a89934ac1469eb204f3c272a Mon Sep 17 00:00:00 2001 From: MattTheTekie Date: Fri, 27 Feb 2026 17:19:25 -0500 Subject: [PATCH] chore: update stuff --- javascript/music-player.js | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/javascript/music-player.js b/javascript/music-player.js index f01b51a..e48abd2 100644 --- a/javascript/music-player.js +++ b/javascript/music-player.js @@ -17,25 +17,32 @@ let NAV_PREV = document.getElementById("navMusicPrevious"); // LOAD MUSIC DATA // =============================== async function loadMusicData() { - const response = await fetch("https://corsproxy.io/?url=https://frutigeraeroarchive.org/data/music.min.json"); + const response = await fetch("https://frutigeraeroarchive.org/data/music.min.json"); const data = await response.json(); const section = data.ols.find(item => item["@id"] === "frutigerAeroBliss"); if (!section) return []; - return section.li.map(item => ({ - title: item.a.title, - url: "https://frutigeraeroarchive.org/music/" + item.a["@data-src-mp3"], - background: item.a["@data-background"] || "", - artist: item.a["@data-artist"] || "", - spotify: item.a["@data-spotify"] || "", - youtube: item.a["@data-youtube"] || "", - description: item.a["@data-description"] || "", - copyright: item.a["@data-copyright"] || "", - date: item.a["@data-date"] || "" - })); -} + return section.li.map(item => { + const raw = item.a["@data-src-mp3"]; + const fullUrl = raw.startsWith("/") + ? "https://frutigeraeroarchive.org" + raw + : "https://frutigeraeroarchive.org/music/" + raw; + + return { + title: item.a.title, + url: fullUrl, + background: item.a["@data-background"] || "", + artist: item.a["@data-artist"] || "", + spotify: item.a["@data-spotify"] || "", + youtube: item.a["@data-youtube"] || "", + description: item.a["@data-description"] || "", + copyright: item.a["@data-copyright"] || "", + date: item.a["@data-date"] || "" + }; + }); +} // =============================== // CREATE PLAYLIST