add 视频下载与重命名

This commit is contained in:
2023-07-22 23:04:26 +08:00
parent be48d26d8c
commit 539131dcec
8 changed files with 158 additions and 33 deletions

View File

@@ -7,7 +7,7 @@ function addDownList(title,url,save,downDate,state,vid){
}
async function getDownList(){
let sql = `select * from download where isOk == 0`
let sql = `select * from download where state == 0`
try{
let list = await getAll(sql)
return list
@@ -18,7 +18,7 @@ async function getDownList(){
}
async function setDownState(id,state){
let sql = `update download set isOk = ? where id = ?`
let sql = `update download set state = ? where id = ?`
await run(sql,state,id)
}

View File

@@ -31,10 +31,21 @@ async function updateSkip(num,id){
await run(sql)
}
// 通过sid获取媒体信息
async function getVideoInfo(sid){
let sql = `select * from VideoInfo where sid=?`
let info = await getAll(sql,sid)
if(info.length > 0){
return info[0]
}else{
return false
}
}
module.exports = {
addSub,
getSub,
delSub,
updateSkip
updateSkip,
getVideoInfo
}