1
0
Code Issues Pull Requests Projects Releases Wiki Activity GitHub Gitee

输出对齐(填充空格)

This commit is contained in:
2022-10-29 17:40:25 +08:00
parent c02dcdf814
commit d332563905
3 changed files with 20 additions and 3 deletions

View File

@@ -3,6 +3,7 @@ const path = require('path');
const requestUtils = require('../../../utils/requestUtils');
const sleepUtils = require('../../../utils/sleepUtils');
const { fill } = require('../../../utils/stringUtils');
const dataManager = require('../dataManager');
const dbUtils = global.dbUtils;
@@ -21,7 +22,7 @@ async function fetchAll({ args = {} }) {
for (let i = 0; i < count; i++) {
await global.checkIsExit();
var subArray = songIds.slice(i * step, (i + 1) * step);
console.log(`${i + 1}/${count} | song: ${subArray[0]}-${subArray.slice(-1)[0]} (${subArray.length}) | ${args.min || "?"}-${args.max || "?"}`);
console.log(`${i + 1}/${count} | song: ${fill(subArray[0], 10)}-${fill(subArray.slice(-1)[0], 10)} ${fill(`(${subArray.length})`, 6, ' ', true)} | ${args.min || "?"}-${args.max || "?"}`);
try {
await fetch({ songIdArray: subArray });
} catch (err) {