From da374a7ed0b97134a9107f81a2308f8eb9d4bb08 Mon Sep 17 00:00:00 2001 From: Franklin-F Date: Fri, 23 May 2025 00:07:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=BF=87=E6=BB=A4=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=8F=82=E6=95=B0=EF=BC=8C=E5=8F=AA=E4=BF=9D=E7=95=99=20video?= =?UTF-8?q?=20=E8=A1=A8=E4=B8=AD=E5=AD=98=E5=9C=A8=E7=9A=84=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DB.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/DB.py b/DB.py index 4b5b24f..0449979 100644 --- a/DB.py +++ b/DB.py @@ -602,13 +602,15 @@ class DBSA: params = dict(stats) params["updatetime"] = int(time.time()) + # 过滤只保留 video 表中存在的列 + valid_cols = set(video.c.keys()) + filtered_params = {k: v for k, v in params.items() if k in valid_cols} - # 使用 Core Table 的 update() 方法 stmt = ( video .update() .where(video.c.v_xid == v_xid, video.c.rn == rn) - .values(**params) + .values(**filtered_params) ) with _engine.begin() as conn: result = conn.execute(stmt)