Fixing comments

pull/59/head
MillenniumEarl 2020-12-15 14:02:41 +01:00
parent ee34665b3a
commit f0caf0f669
1 changed files with 6 additions and 4 deletions

View File

@ -43,11 +43,12 @@ module.exports.fetchLatest = async function(query, limit = 30) {
// Save the URLs // Save the URLs
for(const result of response.data.msg.data) { for(const result of response.data.msg.data) {
if(fetchedResults >= limit) continue; if(fetchedResults < limit) {
const gameURL = new URL(result.thread_id, threadURL).href; const gameURL = new URL(result.thread_id, threadURL).href;
resultURLs.push(gameURL); resultURLs.push(gameURL);
fetchedResults += 1; fetchedResults += 1;
} }
}
// Increment page and check for it's existence // Increment page and check for it's existence
page += 1; page += 1;
@ -93,6 +94,7 @@ function parseLatestURL(query, page = 1) {
url.searchParams.append("tags[]", tag); url.searchParams.append("tags[]", tag);
} }
} }
if (query.prefixes) { if (query.prefixes) {
for (const p of query.prefixes) { for (const p of query.prefixes) {
url.searchParams.append("prefixes[]", p); url.searchParams.append("prefixes[]", p);