修正了下载不完成的bug

This commit is contained in:
Theluyuan 2023-08-22 15:00:31 +08:00
parent d7c34b7f26
commit 9a7ce30a6f
2 changed files with 26 additions and 1 deletions

View File

@ -21,7 +21,11 @@ async function updateSeed(info, desc) {
if(ep.start == ep.end){ if(ep.start == ep.end){
form.append("name", info.title.replace("Epxxx", "E" + info.ep)) form.append("name", info.title.replace("Epxxx", "E" + info.ep))
}else{ }else{
form.append("name", info.title.replace("Epxxx", "E" + ep.start + "-" + "E" + ep.end)) if(ep.start == 1 && ep.end == vinfo.count){
form.append("name", info.title.replace("Epxxx", ""))
}else{
form.append("name", info.title.replace("Epxxx", "E" + ep.start + "-" + "E" + ep.end))
}
} }
await setDownStateVid(info.vid,2) await setDownStateVid(info.vid,2)
form.append("small_descr", vinfo.subtitle) form.append("small_descr", vinfo.subtitle)

View File

@ -29,6 +29,17 @@ async function delSub(id){
async function updateSkip(num,id){ async function updateSkip(num,id){
let sql = `update VideoInfo set skip=${num} where id=${id}` let sql = `update VideoInfo set skip=${num} where id=${id}`
await run(sql) await run(sql)
// 清理完成的订阅
await updateState(id)
}
// skip = 总集数 设置完成
async function updateState(id){
let info = getVideoInfoById(id)
if(info.skip == info.count){
let sql = `update VideoInfo set enable=2 where id=${id}`
await run(sql)
}
} }
// 通过sid获取媒体信息 // 通过sid获取媒体信息
@ -41,6 +52,16 @@ async function getVideoInfo(sid){
return false return false
} }
} }
// 通过id获取媒体信息
async function getVideoInfoById(id){
let sql = `select * from VideoInfo where id=?`
let info = await getAll(sql,id)
if(info.length > 0){
return info[0]
}else{
return false
}
}
module.exports = { module.exports = {