1
0
Code Issues Pull Requests Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-10-07 20:55:04 +08:00
parent 88bb8a4b29
commit 140c8bd61e
5 changed files with 23 additions and 20 deletions

View File

@@ -8,6 +8,7 @@ const dbUtils = global.dbUtils;
// 从数据库中查出还缺少的歌词,并进行爬取
async function fetchAll({ args = {} }) {
if (args.order) console.log("存在 DISTINCT自动升序排序无需指定ORDER BY");
console.log("start fetching lyrics ...");
let whereClause = [
args.min ? `song_id > ${args.min}` : '1=1',
@@ -15,7 +16,6 @@ async function fetchAll({ args = {} }) {
].join(' AND ');
var sql = `
SELECT DISTINCT song_id FROM song WHERE ${whereClause} AND song_id NOT IN ( SELECT song_id FROM lyric )
${args.order ? `ORDER BY song_id ${args.order}` : ''}
${args.limit ? `LIMIT ${args.limit}` : ''}
`;
console.log(sql);