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

bugfix;添加auto.bat

This commit is contained in:
2022-10-29 01:21:48 +08:00
parent ce20720c60
commit d3245038d7
11 changed files with 77 additions and 26 deletions

View File

@@ -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}`);

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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);
}
// 获取音乐详情