From 4d59d64badd171062abcac7c61d087c038b97406 Mon Sep 17 00:00:00 2001 From: Henrik <22085664+henrik9999@users.noreply.github.com> Date: Tue, 15 Jun 2021 17:29:58 +0200 Subject: [PATCH] Update index.js --- index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 9b4c83ef6dd..0a0a94d7396 100644 --- a/index.js +++ b/index.js @@ -26,11 +26,14 @@ async function backup(url, name, type = 'anime', page = 0, ids = {}) { if(json.next) { return await backup(url, name, type, page + 1, ids); } else { + if(type === 'anime') { + return await backup(url, name, 'manga', 0, ids) + } for(item in ids) { await fs.outputFile(`data/${name}/${item}/_index.json`, JSON.stringify(ids[item].sort(), null, 2)) } - if(type === 'anime') { - return await backup(url, name, 'manga') + if(name === 'pages') { + await fs.outputFile(`data/${name}/_index.json`, JSON.stringify(Object.keys(ids).sort(), null, 2)) } return true; } @@ -80,4 +83,4 @@ process.on('unhandledRejection', err => { process.exit(1); }); -start(); \ No newline at end of file +start();