From 25e68ab1d0edce33111d95cad8d90d14b3abd954 Mon Sep 17 00:00:00 2001 From: theluyuan <1162963624@qq.com> Date: Wed, 12 Jul 2023 20:41:05 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E6=B7=BB=E5=8A=A0=E8=AE=A2=E9=98=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/database.db | Bin 16384 -> 32768 bytes router/videoInfo.js | 13 +++++- util/sql/video.js | 16 ++++++- view/src/api/Video.js | 4 +- view/src/page/subscribe/addSubscribe.vue | 52 +++++++++++++++++++---- 5 files changed, 72 insertions(+), 13 deletions(-) diff --git a/db/database.db b/db/database.db index e54188a9b52f4f7ad57b86c5beca359aeac126c3..70ce26c66d2c6dbbaa7c9ac4979d27f8e16fc352 100644 GIT binary patch literal 32768 zcmeHP+fN%;8aL21ffdcRtKDdK73GL(l|)ML4Re#KuA9&;%B3x#7usD_1D?Rd*h77R zg0!l+gj)!Z1i~GYki;Y*ToO`@&E=s_`&eoJg5Wckr>ZaevM>9c8QU0N2&|gjwmHr? zV`jej&Ub#_WzL!TzH{Njvz&`X7kP(`aUrAT*P666&7Tp{Xf#In9)RzD_`U+)*TZ|* zDW9~+j~(_#P3}cGJNq?FMwVUktAAvV!H#|?0u%v?07ZZzKoOt_Py}8Y1X@1L*njBA zk+in2T})*y>vUH-s~lYA){j?Cm6e#wOHjG_owFqO=MB?2L`gK_8pTPQ7O?J7zGMjz`a<(SIe@{A?2Pu~t~*IY8|IwvTVp^>XcXntZ!;SLd@2yZ5w8;aY_a#_)9CT%DRmFd0uETt?b@{*>>gMHErfs=&BZ&T zPH|VKl}q9yQ8Q49cJyi8QE;>*=DFo=(97K!I?CZ})hRqPDiXvQl(RjAY{LT-`itff)}K+_-ruwjMsWJ2ip!FfF1o%1SkR&0g3=cfFeK$mr13b*ft{Ex)ZHo0Y5?CKDnE+cVvR%evQ+G|{{I%ly~ zTc7*om$_BEP5YI$imzuKT3b_dJ4w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b{)8T?H_j4Hg+Z z?Jd`IPixu0xa?=S3SeA-r0@S>0YLix|G!^Als*NZPXXvt042*Va@V0N0MZoz!}Im1 ZNzfGl)rtkW0w7%h@WrnH_)B{K{~z(4R`mb? delta 120 zcmZo@U}|V!oFFYI!@$760>m)DGf~GFD5w`N!^_LZz|57$zeWh zvnN+@&E#%r@n&KN@jFr{FXg>DxsXR>@@+10u9EzsqSU;S;KZ`Yr?@mGSMmMY{DNOb OU@?n { router.post("/addSubscribe", async (ctx) => { // console.log(ctx.request.body) let data = ctx.request.body + try { + let r = await addSub(data) + if(r){ + ctx.body = "订阅已存在" + }else{ + ctx.body = "添加成功" + } + }catch { + ctx.body = "添加失败" + } }) diff --git a/util/sql/video.js b/util/sql/video.js index ba9a851..a0edda3 100644 --- a/util/sql/video.js +++ b/util/sql/video.js @@ -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 } \ No newline at end of file diff --git a/view/src/api/Video.js b/view/src/api/Video.js index 7e3442a..993960d 100644 --- a/view/src/api/Video.js +++ b/view/src/api/Video.js @@ -25,6 +25,6 @@ export async function getImdbName(url) { }) } -export async function addSubscribe({name, desc, year, season, ep, url}) { - return await base.post("/videoInfo/addSubscribe", {name, desc, year, season, ep, url}) +export async function addSubscribe({name, rename, desc, year, season, ep, url, img, subtitle, time,skip,sid}) { + return await base.post("/videoInfo/addSubscribe", {name, rename, desc, year, season, ep, url, img, subtitle, time,skip,sid}) } \ No newline at end of file diff --git a/view/src/page/subscribe/addSubscribe.vue b/view/src/page/subscribe/addSubscribe.vue index a2103a3..947309d 100644 --- a/view/src/page/subscribe/addSubscribe.vue +++ b/view/src/page/subscribe/addSubscribe.vue @@ -36,6 +36,10 @@ 地址: +
+ 检查更新时间: + +