feat: cache and download music

This commit is contained in:
Fredrik Burmester
2026-01-04 12:50:41 +01:00
parent b1da9f8777
commit ab3465aec5
22 changed files with 1616 additions and 110 deletions

View File

@@ -24,7 +24,8 @@ const NetworkStatusContext = createContext<NetworkStatusContextType | null>(
async function checkApiReachable(basePath?: string): Promise<boolean> {
if (!basePath) return false;
try {
const response = await fetch(basePath, { method: "HEAD" });
const url = basePath.endsWith("/") ? basePath : `${basePath}/`;
const response = await fetch(url, { method: "HEAD" });
return response.ok;
} catch {
return false;