bugfix;添加auto.bat
This commit is contained in:
@@ -48,6 +48,8 @@ async function fetch({ albumId, debug = false, update = false }) {
|
||||
let result = await dbUtils.query('SELECT count(*) as count FROM album WHERE album_id = ?', [albumId]);
|
||||
if (!debug && !update && result[0].count > 0) {
|
||||
console.log(`数据库中已有数据,跳过 albumId: ${albumId}`);
|
||||
// 从待爬取表中删除记录
|
||||
await dataManager.wait_fetch.deleteCollection("album", [albumId]);
|
||||
return;
|
||||
} else if (update && result[0].count == 0) {
|
||||
console.log(`数据库中沒有数据,跳过 albumId: ${albumId}`);
|
||||
|
@@ -44,6 +44,8 @@ async function fetch({ artistId, debug = false }) {
|
||||
let result = await dbUtils.query('SELECT count(*) as count FROM artist WHERE artist_id = ?', [artistId]);
|
||||
if (result[0].count > 0 && !debug) {
|
||||
console.log(`数据库中已有数据,跳过 artistId: ${artistId}`);
|
||||
// 从待爬取表中删除记录
|
||||
await dataManager.wait_fetch.deleteCollection("artist", [artistId]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -30,6 +30,8 @@ async function fetch({ songId, debug = false }) {
|
||||
if (result[0].count > 0 && !debug) {
|
||||
// 这里暂时跳过,后期可能要考虑歌词version更新的问题
|
||||
console.log(`数据库中已有数据,跳过 songId: ${songId}`);
|
||||
// 从待爬取表中删除记录
|
||||
await dataManager.wait_fetch.deleteCollection("lyric", [songId]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -97,7 +97,7 @@ async function fetch({ songIdArray, debug = false }) {
|
||||
await dataManager.song.insertCollection(songInfoList); // image 因为接口没有返回,所以不更新
|
||||
|
||||
// 从待爬取表中删除记录
|
||||
await dataManager.wait_fetch.deleteCollection("song", [songId]);
|
||||
await dataManager.wait_fetch.deleteCollection("song", songIdArray);
|
||||
}
|
||||
|
||||
// 获取音乐详情
|
||||
|
Reference in New Issue
Block a user