Restore commented content
							parent
							
								
									6ff1eebfbb
								
							
						
					
					
						commit
						b25bf8ac34
					
				| 
						 | 
					@ -6,7 +6,6 @@ import SearchQuery from "./classes/search-query.js";
 | 
				
			||||||
import { urls as f95url } from "./constants/url.js";
 | 
					import { urls as f95url } from "./constants/url.js";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * @public
 | 
					 | 
				
			||||||
 * Gets the URLs of the latest updated games that match the passed parameters.
 | 
					 * Gets the URLs of the latest updated games that match the passed parameters.
 | 
				
			||||||
 * You *must* be logged.
 | 
					 * You *must* be logged.
 | 
				
			||||||
 * @param {SearchQuery} query
 | 
					 * @param {SearchQuery} query
 | 
				
			||||||
| 
						 | 
					@ -31,17 +30,20 @@ export async function fetchLatest(query: SearchQuery, limit = 30): Promise<strin
 | 
				
			||||||
        const response = await fetchGETResponse(url);
 | 
					        const response = await fetchGETResponse(url);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Save the URLs
 | 
					        // Save the URLs
 | 
				
			||||||
        // for(const result of response.data.msg.data) {
 | 
					        //@ts-ignore
 | 
				
			||||||
        //     if(fetchedResults < limit) {
 | 
					        for(const result of response.data.msg.data) {
 | 
				
			||||||
        //         const gameURL = new URL(result.thread_id, threadURL).href;
 | 
					            if(fetchedResults < limit) {
 | 
				
			||||||
        //         resultURLs.push(gameURL);
 | 
					                const gameURL = new URL(result.thread_id, threadURL).href;
 | 
				
			||||||
        //         fetchedResults += 1;
 | 
					                resultURLs.push(gameURL);
 | 
				
			||||||
        //     }
 | 
					                fetchedResults += 1;
 | 
				
			||||||
        // }
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        // Increment page and check for it's existence
 | 
					        // Increment page and check for it's existence
 | 
				
			||||||
        page += 1;
 | 
					        page += 1;
 | 
				
			||||||
        //if (page > response.data.msg.pagination.total) noMorePages = true;
 | 
					
 | 
				
			||||||
 | 
					        //@ts-ignore
 | 
				
			||||||
 | 
					        if (page > response.data.msg.pagination.total) noMorePages = true;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    while (fetchedResults < limit && !noMorePages);
 | 
					    while (fetchedResults < limit && !noMorePages);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue