Skip to content

Commit

Permalink
Use an alternate way of getting post data
Browse files Browse the repository at this point in the history
  • Loading branch information
bitWolfy committed May 2, 2020
1 parent a76021c commit 3f38aab
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/js/modules/pools/PoolDownloader.ts
Expand Up @@ -148,9 +148,10 @@ export class PoolDownloader extends RE6Module {
.html(`Fetching API data . . .`);

const dataQueue: Promise<APIPost[]>[] = [];
Util.chunkArray(imageList, PoolDownloader.chunkSize).forEach((value) => {
dataQueue.push(E621.Posts.get<APIPost>({ tags: "id:" + value.join(",") }));
});
const resultPages = Math.ceil(imageList.length / 320);
for (let i = 1; i <= resultPages; i++) {
dataQueue.push(E621.Posts.get<APIPost>({ tags: "pool:" + pool.id, page: i, limit: 320 }));
}

return Promise.all(dataQueue);
}).then((dataChunks) => {
Expand Down

0 comments on commit 3f38aab

Please sign in to comment.