This commit is contained in:
2025-03-28 13:53:35 +01:00
commit d2848447b6
8 changed files with 521 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
const baseUrlsearch = 'https://api.discogs.com/database/search';
const baseUrlrelease = 'https://api.discogs.com/releases/';
const key = 'NWmMhlPAbPlVnaDqVGyX';
const secret = 'hZPaoBiGiSwlCjARrbOICOpDuITwyJAm';
const perPage = 100;
export async function discogsearch(query, type) {
const url = `${baseUrlsearch}?q=${query}&type=${type}&per_page=${perPage}&key=${key}&secret=${secret}`;
const response = await fetch(url);
return await response.json();
}
export async function getReleaseDetails(releaseId) {
const response = await fetch(`${baseUrlrelease}${releaseId}`);
return await response.json();
}
window.getReleaseDetails = getReleaseDetails;
window.discogsearch = discogsearch;