ptSend/util/sql/download.js

41 lines
902 B
JavaScript
Raw Normal View History

2023-06-28 21:11:21 +08:00
const { run, getAll } = require("./base");
2023-06-20 22:34:27 +08:00
2023-06-29 21:59:57 +08:00
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)
2023-06-28 21:11:21 +08:00
}
async function getDownList(){
let sql = `select * from download where isOk == 0`
try{
let list = await getAll(sql)
return list
}catch(err){
console.error(err)
return []
}
}
async function setDownState(id,state){
let sql = `update download set isOk = ? where id = ?`
await run(sql,state,id)
}
2023-06-29 21:59:57 +08:00
async function getVideoInfo(url){
if(url){
let sql = `select * from VideoInfo where url = '?'`
let list = await getAll(sql,url)
}else{
let sql = `insert into `
}
}
async function addVideoInfo(cover){
}
2023-06-28 21:11:21 +08:00
module.exports = {
addDownList,
getDownList,
setDownState
2023-06-20 22:34:27 +08:00
}