From 52a5e4a51bfd8ef23ba79c4c0742ab524991de6e Mon Sep 17 00:00:00 2001 From: thsrite Date: Wed, 26 Mar 2025 09:18:38 +0800 Subject: [PATCH] =?UTF-8?q?fix=20SubscribeReminder=20=E5=8D=95=E6=AC=A1?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 ++- plugins/subscribereminder/__init__.py | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index d5889c8..122fc76 100644 --- a/package.json +++ b/package.json @@ -211,12 +211,13 @@ "name": "订阅提醒", "description": "推送当天订阅更新内容。", "labels": "订阅", - "version": "1.4", + "version": "1.5", "icon": "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/subscribe_reminder.png", "author": "thsrite", "level": 1, "v2": true, "history": { + "v1.5": "单次消息图片", "v1.4": "单次消息发送8条更新,以此类推", "v1.3": "修复消息类型不生效", "v1.2": "可选订阅类型、推送类型,随机获取订阅图片", diff --git a/plugins/subscribereminder/__init__.py b/plugins/subscribereminder/__init__.py index 17bbf5e..7ffcd61 100644 --- a/plugins/subscribereminder/__init__.py +++ b/plugins/subscribereminder/__init__.py @@ -23,7 +23,7 @@ class SubscribeReminder(_PluginBase): # 插件图标 plugin_icon = "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/subscribe_reminder.png" # 插件版本 - plugin_version = "1.4" + plugin_version = "1.5" # 插件作者 plugin_author = "thsrite" # 作者主页 @@ -166,24 +166,27 @@ class SubscribeReminder(_PluginBase): # 处理电视剧订阅 if "tv" in self._subtype and current_tv_subscribe: text = "" + image = [] count = 0 for sub in current_tv_subscribe: text += f"📺︎{sub.get('name')} {sub.get('season')}{sub.get('episode')}\n" count += 1 + image.append(sub.get('image')) if count % 8 == 0: # 每8条发送一次 self.post_message(mtype=mtype, title="电视剧更新", text=text, - image=random.choice(current_tv_subscribe)["image"]) + image=random.choice(image)) logger.info(f"推送电视剧更新:{text}") text = "" # 重置text变量以开始新的消息 + image = [] # 如果还有剩余未发送的内容 if text: self.post_message(mtype=mtype, title="电视剧更新", text=text, - image=random.choice(current_tv_subscribe)["image"]) + image=random.choice(image)) logger.info(f"推送电视剧更新:{text}") # 处理电影订阅