fix minor metadata fetch issue

This commit is contained in:
Jill 2024-02-29 13:00:07 +03:00
parent aafe27d551
commit bc98cc6eaa
1 changed files with 5 additions and 0 deletions

View File

@ -77,6 +77,11 @@ async function fetchLevelData(name, creator, loose = false) {
const { statusCode, headers, trailers, body } = await request(`https://history.geometrydash.eu/api/v1/search/level/advanced/?${params.toString()}`);
const data = await body.json();
if (!data.hits) {
console.warn('got fucked up response from gdhistory:', data);
return
}
if (data.hits.length === 0 && !loose) {
return await fetchLevelData(name, creator, true);
} else if (data.hits.length === 0) {