bugfix
This commit is contained in:
		@@ -20,6 +20,10 @@ async function fetchAll({ args = {} }) {
 | 
			
		||||
    // `, []);
 | 
			
		||||
    let songIds = await dataManager.comment.getIdsToFetch(args);
 | 
			
		||||
    console.log(`songIds was fetched, count: ${songIds.length}`);
 | 
			
		||||
    if (songIds.length == 0) {
 | 
			
		||||
        console.log("完成!");
 | 
			
		||||
        process.exit(0);
 | 
			
		||||
    }
 | 
			
		||||
    for (let i = 0; i < songIds.length; i++) {
 | 
			
		||||
        await global.checkIsExit();
 | 
			
		||||
        const songId = songIds[i];
 | 
			
		||||
 
 | 
			
		||||
@@ -12,6 +12,10 @@ async function fetchAll({ args = {} }) {
 | 
			
		||||
    console.log("start fetching lyrics ...");
 | 
			
		||||
    let songIds = await dataManager.lyric.getIdsToFetch(args);
 | 
			
		||||
    console.log(`songIds was fetched, count: ${songIds.length}`);
 | 
			
		||||
    if (songIds.length == 0) {
 | 
			
		||||
        console.log("完成!");
 | 
			
		||||
        process.exit(0);
 | 
			
		||||
    }
 | 
			
		||||
    for (let i = 0; i < songIds.length; i++) {
 | 
			
		||||
        await global.checkIsExit();
 | 
			
		||||
        const songId = songIds[i];
 | 
			
		||||
 
 | 
			
		||||
@@ -65,42 +65,37 @@ async function main(args) {
 | 
			
		||||
        switch (args.utils) {
 | 
			
		||||
            case 'song':
 | 
			
		||||
                await songInfoUtils.fetchAll({ args: args });
 | 
			
		||||
                cycle && await sleepUtils.sleep(60 * 1000);
 | 
			
		||||
                await sleepUtils.sleep(60 * 1000);
 | 
			
		||||
                break;
 | 
			
		||||
            case 'album':
 | 
			
		||||
                await albumInfoUtils.fetchAll({ args: args });
 | 
			
		||||
                cycle && await sleepUtils.sleep(30 * 1000);
 | 
			
		||||
                await sleepUtils.sleep(30 * 1000);
 | 
			
		||||
                break;
 | 
			
		||||
            case 'artist':
 | 
			
		||||
                await artistInfoUtils.fetchAll({ args: args });
 | 
			
		||||
                cycle && await sleepUtils.sleep(30 * 1000);
 | 
			
		||||
                await sleepUtils.sleep(30 * 1000);
 | 
			
		||||
                break;
 | 
			
		||||
            case 'lyric':
 | 
			
		||||
            case 'lyric': // 执行完就退出
 | 
			
		||||
                await lyricInfoUtils.fetchAll({ args: args });
 | 
			
		||||
                cycle && await sleepUtils.sleep(30 * 1000);
 | 
			
		||||
                // await sleepUtils.sleep(30 * 1000);
 | 
			
		||||
                break;
 | 
			
		||||
            case 'comment':
 | 
			
		||||
            case 'comment': // 执行完就退出
 | 
			
		||||
                await commentUtils.fetchAll({ args: args });
 | 
			
		||||
                cycle && await sleepUtils.sleep(30 * 1000);
 | 
			
		||||
                // await sleepUtils.sleep(30 * 1000);
 | 
			
		||||
                break;
 | 
			
		||||
            case 'playlist':
 | 
			
		||||
            case 'playlist': // 执行完就退出
 | 
			
		||||
                await playlistUtils.fetchTop({ args: args });
 | 
			
		||||
                process.exit(0);
 | 
			
		||||
                break;
 | 
			
		||||
 | 
			
		||||
            case 'assistant':
 | 
			
		||||
                await assistantUtils.updateWaitTable();
 | 
			
		||||
                cycle && await sleepUtils.sleep(20 * 1000);
 | 
			
		||||
                await sleepUtils.sleep(20 * 1000);
 | 
			
		||||
                break;
 | 
			
		||||
            default:
 | 
			
		||||
                console.log("utils参数不匹配,退出");
 | 
			
		||||
                return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (!cycle) {
 | 
			
		||||
            console.log("完成!");
 | 
			
		||||
            process.exit(0);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user