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"])