hifini 添加 order limit 参数
This commit is contained in:
parent
71eb3b7ce5
commit
b93e1598e6
2
hifini_music/auto desc.bat
Normal file
2
hifini_music/auto desc.bat
Normal file
@ -0,0 +1,2 @@
|
||||
start cmd /k "node index --order DESC --limit 200"
|
||||
exit
|
@ -1,2 +1,2 @@
|
||||
start cmd /k "node index"
|
||||
start cmd /k "node index --order ASC --limit 200"
|
||||
exit
|
@ -14,6 +14,11 @@ const dataManager = require('./src/dataManager');
|
||||
const requestUtils = require('../utils/requestUtils');
|
||||
|
||||
async function main() {
|
||||
var args = require('minimist')(process.argv.slice(2));
|
||||
global.args = {
|
||||
"order": args.order,
|
||||
"limit": args.limit,
|
||||
}
|
||||
// async function timeout1() {
|
||||
// await getList();
|
||||
// setTimeout(() => console.log("getList已完成"), 2000);
|
||||
|
@ -20,11 +20,23 @@ module.exports = {
|
||||
},
|
||||
|
||||
getIdsToFetch: async () => {
|
||||
return await dbUtils.query(`SELECT thread_id FROM hifini_thread where music_title='' and music_pic='' and music_url=''`);
|
||||
let sql = `
|
||||
SELECT thread_id FROM hifini_thread WHERE music_title='' and music_pic='' and music_url=''
|
||||
${global.args?.order ? `ORDER BY thread_id ${global.args.order}` : ""}
|
||||
${global.args?.limit ? `LIMIT ${global.args.limit}` : ""}
|
||||
`;
|
||||
console.log(sql);
|
||||
return await dbUtils.query(sql);
|
||||
},
|
||||
|
||||
getIdsToFetchRealUrl: async () => {
|
||||
return await dbUtils.query(`SELECT thread_id,music_url FROM hifini_thread where music_url like 'get_music.php?key=%' and music_real_url=''`);
|
||||
let sql = `
|
||||
SELECT thread_id,music_url FROM hifini_thread WHERE music_url like 'get_music.php?key=%' and music_real_url=''
|
||||
${global.args?.order ? `ORDER BY thread_id ${global.args.order}` : ""}
|
||||
${global.args?.limit ? `LIMIT ${global.args.limit}` : ""}
|
||||
`;
|
||||
console.log(sql);
|
||||
return await dbUtils.query(sql);
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user