From fe3de1327afc1fb523e992b2f8236edbb7c863e4 Mon Sep 17 00:00:00 2001 From: DzAvril Date: Fri, 11 Apr 2025 16:49:43 +0800 Subject: [PATCH] Update zvideohelper to v1.5 --- package.json | 3 ++- plugins/zvideohelper/__init__.py | 23 ++++++++++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 42e01f5..c8e7537 100644 --- a/package.json +++ b/package.json @@ -897,12 +897,13 @@ "name": "极影视助手", "description": "极影视功能扩展", "labels": "媒体库", - "version": "1.4", + "version": "1.5", "icon": "zvideo.png", "author": "DzAvril", "level": 1, "v2": true, "history": { + "v1.5": "适配新版极影视", "v1.4": "修复请求失败后返回值数量不正确的问题", "v1.3": "降低对豆瓣接口的请求频率", "v1.2": "修复无法获取豆瓣评分的问题", diff --git a/plugins/zvideohelper/__init__.py b/plugins/zvideohelper/__init__.py index f2a455e..285fdd1 100644 --- a/plugins/zvideohelper/__init__.py +++ b/plugins/zvideohelper/__init__.py @@ -31,7 +31,7 @@ class ZvideoHelper(_PluginBase): # 插件图标 plugin_icon = "zvideo.png" # 插件版本 - plugin_version = "1.4" + plugin_version = "1.5" # 插件作者 plugin_author = "DzAvril" # 作者主页 @@ -292,8 +292,12 @@ class ZvideoHelper(_PluginBase): ) for meta_info in meta_info_list: - douban_id = meta_info["relation"]["douban"]["douban_id"] - title = meta_info["title"] + try: + douban_id = meta_info["relation"]["douban"]["douban_id"] + title = meta_info["title"] + except Exception as e: + logger.error(f"meta_info: {meta_info},解析失败: {e}") + continue if self._cached_data.get(title) != None: logger.info(f"已处理过: {title},跳过...") continue @@ -374,8 +378,12 @@ class ZvideoHelper(_PluginBase): ) for meta_info in meta_info_list: - douban_id = meta_info["relation"]["douban"]["douban_id"] - title = meta_info["title"] + try: + douban_id = meta_info["relation"]["douban"]["douban_id"] + title = meta_info["title"] + except Exception as e: + logger.error(f"meta_info: {meta_info},解析失败: {e}") + continue if self._cached_data.get(title) == DoubanStatus.DONE.value: logger.info(f"已处理过: {title},跳过...") continue @@ -491,7 +499,7 @@ class ZvideoHelper(_PluginBase): cursor.execute( """ UPDATE zvideo_collection - SET meta_info = JSON_SET(meta_info, '$.score', CAST(JSON_EXTRACT(meta_info, '$.douban_score') AS JSON)) + SET score = CAST(JSON_EXTRACT(meta_info, '$.douban_score') AS DECIMAL(3,1)) WHERE CAST(JSON_EXTRACT(meta_info, '$.douban_score') AS DECIMAL(3,1)) <> 0.0 """ ) @@ -511,7 +519,8 @@ class ZvideoHelper(_PluginBase): cursor.execute( """ UPDATE zvideo_collection - SET meta_info = JSON_SET(meta_info, '$.score', CAST(score AS JSON)) + SET score = CAST(JSON_EXTRACT(meta_info, '$.score') AS DECIMAL(3,1)) + WHERE JSON_EXTRACT(meta_info, '$.score') IS NOT NULL """ ) conn.commit()