feat 云盘助手v2.0

调整通知图片
This commit is contained in:
thsrite
2024-06-25 16:19:10 +08:00
parent cbecb0b6f9
commit 3b71f583a6
3 changed files with 21 additions and 6 deletions

View File

@@ -42,7 +42,7 @@ MoviePilot三方插件市场https://github.com/thsrite/MoviePilot-Plugins/
- 目录监控(统一入库消息增强版) v1.0
- Sql执行器 v1.2
- 命令执行器 v1.2
- 云盘助手(docs%2FCloudAssistant.md) v1.9
- 云盘助手(docs%2FCloudAssistant.md) v2.0
- CloudDrive2助手 v1.2
- 软连接重定向 v1.0
- 云盘同步删除 v1.1

View File

@@ -521,11 +521,12 @@
"name": "云盘助手",
"description": "本地文件定时转移到云盘,软连接/strm回本地定时清理无效软连接。",
"labels": "云盘",
"version": "1.8",
"version": "2.0",
"icon": "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/cloudassistant.png",
"author": "thsrite",
"level": 3,
"history": {
"v2.0": "调整通知图片",
"v1.9": "修复非媒体文件转移bug需要主程序1.9.9+",
"v1.8": "支持可选开启实时监控",
"v1.7": "转移完成发送消息通知(插件类型消息)",

View File

@@ -27,7 +27,7 @@ from app.db.transferhistory_oper import TransferHistoryOper
from app.log import logger
from app.modules.emby import Emby
from app.plugins import _PluginBase
from app.schemas.types import EventType, SystemConfigKey, MediaType, NotificationType
from app.schemas.types import EventType, SystemConfigKey, MediaType, NotificationType, MediaImageType
from app.utils.http import RequestUtils
from app.utils.string import StringUtils
from app.utils.system import SystemUtils
@@ -64,7 +64,7 @@ class CloudAssistant(_PluginBase):
# 插件图标
plugin_icon = "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/cloudassistant.png"
# 插件版本
plugin_version = "1.9"
plugin_version = "2.0"
# 插件作者
plugin_author = "thsrite"
# 作者主页
@@ -623,6 +623,20 @@ class CloudAssistant(_PluginBase):
}
"""
key = f"{transferhis.title} ({transferhis.year})"
# 获取图片
try:
backrop_image = self.chain.obtain_specific_image(
mediaid=transferhis.tmdbid,
mtype=MediaType(transferhis.type),
image_type=MediaImageType.Backdrop,
season=int(transferhis.seasons.replace("S", "")) if transferhis.seasons else None,
episode=int(transferhis.episodes.replace("E", "")) if transferhis.episodes else None,
) or transferhis.image
except Exception as e:
logger.error(f"获取图片失败 {str(e)} 使用转移记录图片")
backrop_image = transferhis.image
# 发送消息汇总
media_list = self._medias.get(
key + " " + transferhis.seasons) or {}
@@ -637,7 +651,7 @@ class CloudAssistant(_PluginBase):
"key": key,
"mtype": transferhis.type,
"category": transferhis.category,
"image": transferhis.image,
"image": backrop_image,
"season": transferhis.seasons,
"episodes": episodes,
"time": datetime.datetime.now()
@@ -647,7 +661,7 @@ class CloudAssistant(_PluginBase):
"key": key,
"mtype": transferhis.type,
"category": transferhis.category,
"image": transferhis.image,
"image": backrop_image,
"season": transferhis.seasons,
"episodes": [transferhis.episodes.replace("E", "")],
"time": datetime.datetime.now()