From ec96e4331ad387114427113355ac48d092e2cda9 Mon Sep 17 00:00:00 2001 From: thsrite Date: Thu, 31 Oct 2024 13:16:29 +0800 Subject: [PATCH] =?UTF-8?q?fix=20SubscribeReminder=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E7=B1=BB=E5=9E=8B=E4=B8=8D=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 ++- plugins/subscribereminder/__init__.py | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index f6fd2c4..11abc83 100644 --- a/package.json +++ b/package.json @@ -202,12 +202,13 @@ "name": "订阅提醒", "description": "推送当天订阅更新内容。", "labels": "订阅", - "version": "1.2", + "version": "1.3", "icon": "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/subscribe_reminder.png", "author": "thsrite", "level": 1, "v2": true, "history": { + "v1.3": "修复消息类型不生效", "v1.2": "可选订阅类型、推送类型,随机获取订阅图片", "v1.1": "fix icon", "v1.0": "推送当天订阅更新内容" diff --git a/plugins/subscribereminder/__init__.py b/plugins/subscribereminder/__init__.py index b77355e..b2fe982 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.2" + plugin_version = "1.3" # 插件作者 plugin_author = "thsrite" # 作者主页 @@ -117,6 +117,10 @@ class SubscribeReminder(_PluginBase): # 当前日期 current_date = datetime.now().date().strftime("%Y-%m-%d") + mtype = NotificationType.Plugin + if self._msgtype: + mtype = NotificationType.__getitem__(str(self._msgtype)) or NotificationType.Manual + current_tv_subscribe = [] current_movie_subscribe = [] # 遍历订阅,查询tmdb @@ -166,7 +170,7 @@ class SubscribeReminder(_PluginBase): text += f"📺︎{sub.get('name')} {sub.get('season')}{sub.get('episode')}\n" if text: - self.post_message(mtype=NotificationType.Subscribe, + self.post_message(mtype=mtype, title="电视剧更新", text=text, image=random.choice(current_tv_subscribe)["image"]) @@ -175,7 +179,7 @@ class SubscribeReminder(_PluginBase): for sub in current_movie_subscribe: text += f"📽︎{sub.get('name')}\n" if text: - self.post_message(mtype=NotificationType.Subscribe, + self.post_message(mtype=mtype, title="电影更新", text=text, image=random.choice(current_movie_subscribe)["image"])