修正了下载不完成的bug
This commit is contained in:
parent
d7c34b7f26
commit
9a7ce30a6f
@ -21,7 +21,11 @@ async function updateSeed(info, desc) {
|
||||
if(ep.start == ep.end){
|
||||
form.append("name", info.title.replace("Epxxx", "E" + info.ep))
|
||||
}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)
|
||||
form.append("small_descr", vinfo.subtitle)
|
||||
|
@ -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 = {
|
||||
|
Loading…
Reference in New Issue
Block a user