From 3067bc62df26de0aa0c8cd76717a3936fc2a48ae Mon Sep 17 00:00:00 2001 From: thsrite Date: Mon, 5 Aug 2024 16:28:34 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E5=AE=89=E8=A3=85=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- package.json | 3 ++- plugins/cd2assistant/__init__.py | 12 ++++++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index fc2b066..1a427d1 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ MoviePilot三方插件市场:https://github.com/thsrite/MoviePilot-Plugins/ - 目录监控(统一入库消息增强版) v1.0 - Sql执行器 v1.3 - 命令执行器 v1.2 -- [CloudDrive2助手v1.7](docs%2FCd2Assistant.md) +- [CloudDrive2助手v1.8](docs%2FCd2Assistant.md) - 软连接重定向 v1.1 - 云盘同步删除 v1.5.1 - 媒体库重复媒体检测 v1.9 diff --git a/package.json b/package.json index 4a4f9e1..49534f9 100644 --- a/package.json +++ b/package.json @@ -587,11 +587,12 @@ "name": "CloudDrive2助手", "description": "监控上传任务,检测是否有异常,发送通知。", "labels": "云盘", - "version": "1.7", + "version": "1.8", "icon": "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/clouddrive.png", "author": "thsrite", "level": 2, "history": { + "v1.8": "修复插件依赖安装问题", "v1.7": "增加HomePage自定义API(详见插件说明)", "v1.6": "支持交互命令云下载", "v1.5": "增加云盘同步黑名单(排序挂载本地目录)", diff --git a/plugins/cd2assistant/__init__.py b/plugins/cd2assistant/__init__.py index 6181965..d1dba51 100644 --- a/plugins/cd2assistant/__init__.py +++ b/plugins/cd2assistant/__init__.py @@ -2,9 +2,13 @@ import re from datetime import datetime, timedelta import pytz -from clouddrive import CloudDriveClient, Client -from clouddrive.proto import CloudDrive_pb2 - +try: + from clouddrive import CloudDriveClient, Client + from clouddrive.proto import CloudDrive_pb2 +except ImportError: + from sys import executable + from subprocess import run + run([executable, "-m", "pip", "install", "-U", "clouddrive"], check=True) from app import schemas from app.core.config import settings from app.core.event import eventmanager, Event @@ -26,7 +30,7 @@ class Cd2Assistant(_PluginBase): # 插件图标 plugin_icon = "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/clouddrive.png" # 插件版本 - plugin_version = "1.7" + plugin_version = "1.8" # 插件作者 plugin_author = "thsrite" # 作者主页