add 添加订阅
This commit is contained in:
@@ -1,6 +1,18 @@
|
||||
const { run, getAll } = require("./base");
|
||||
const dayjs = require("dayjs");
|
||||
|
||||
function addSub(info){
|
||||
let sql = `insert into download(name,rename,skip,desc,url,subtitle,img) values(?,?,?,?,?,?)`
|
||||
async function addSub(info){
|
||||
|
||||
let selSql = `select * from VideoInfo where sid='${info.sid}' and season=${info.season}`
|
||||
let list = await getAll(selSql)
|
||||
if(list.length != 0){
|
||||
return "订阅已存在"
|
||||
}
|
||||
let sql = `insert into VideoInfo(name,rename,skip,desc,url,subtitle,img,year,time,subTime,enable,season,sid) values(?,?,?,?,?,?,?,?,?,${new Date().getTime()},1,?,?)`
|
||||
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)
|
||||
}
|
||||
|
||||
|
||||
module.exports = {
|
||||
addSub
|
||||
}
|
||||
Reference in New Issue
Block a user