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