chore: update stuff
This commit is contained in:
parent
2377feec3b
commit
9c92f4930f
1 changed files with 20 additions and 13 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue