mirror of
https://github.com/thsrite/MoviePilot-Plugins.git
synced 2026-03-27 10:05:57 +00:00
fix SubscribeReminder 单次消息图片
This commit is contained in:
@@ -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": "可选订阅类型、推送类型,随机获取订阅图片",
|
||||
|
||||
@@ -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}")
|
||||
|
||||
# 处理电影订阅
|
||||
|
||||
Reference in New Issue
Block a user