修正了下载不完成的bug
This commit is contained in:
@@ -29,6 +29,17 @@ async function delSub(id){
|
||||
async function updateSkip(num,id){
|
||||
let sql = `update VideoInfo set skip=${num} where id=${id}`
|
||||
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获取媒体信息
|
||||
@@ -41,6 +52,16 @@ async function getVideoInfo(sid){
|
||||
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 = {
|
||||
|
||||
Reference in New Issue
Block a user