add 订阅自动检查更新
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
const { run, getAll } = require("./base");
|
||||
|
||||
function addDownList(title,url,save,downDate,isOk,vid){
|
||||
let sql = `insert into download(title,url,save,downDate,isOk,vid) values(?,?,?,?,?,?)`
|
||||
run(sql,title,url,save,downDate,isOk,vid)
|
||||
// state 0未下载 1下载完成 2已发种
|
||||
function addDownList(title,url,save,downDate,state,vid){
|
||||
let sql = `insert into download(title,url,save,downDate,state,vid) values(?,?,?,?,?,?)`
|
||||
run(sql,title,url,save,downDate,state,vid)
|
||||
}
|
||||
|
||||
async function getDownList(){
|
||||
|
||||
@@ -12,20 +12,29 @@ async function addSub(info){
|
||||
await run(sql,info.name,info.rename,info.skip,info.desc,info.url,info.subtitle,info.img,info.year,info.time,info.season,info.sid,info.count)
|
||||
}
|
||||
|
||||
// 获取所有订阅 (不包括已完成)
|
||||
async function getSub(){
|
||||
let sql = `select * from VideoInfo`
|
||||
let sql = `select * from VideoInfo where enable=1`
|
||||
let list = await getAll(sql)
|
||||
return list
|
||||
}
|
||||
|
||||
|
||||
|
||||
async function delSub(id){
|
||||
let sql = `delete from VideoInfo where id=${id}`
|
||||
await run(sql)
|
||||
}
|
||||
|
||||
async function updateSkip(num,id){
|
||||
let sql = `update VideoInfo set skip=${num} where id=${id}`
|
||||
await run(sql)
|
||||
}
|
||||
|
||||
|
||||
module.exports = {
|
||||
addSub,
|
||||
getSub,
|
||||
delSub
|
||||
delSub,
|
||||
updateSkip
|
||||
}
|
||||
Reference in New Issue
Block a user