From 578546e36190faaac3bcadf94933a2f502c9210a Mon Sep 17 00:00:00 2001 From: thsrite Date: Sun, 14 Jul 2024 17:31:16 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8Dstrm=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 ++- plugins/cloudassistant/__init__.py | 14 +++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index f9bbd5e..3090d8f 100644 --- a/package.json +++ b/package.json @@ -542,12 +542,13 @@ "name": "云盘助手", "description": "本地文件定时转移到云盘,软连接/strm回本地,定时清理无效软连接。", "labels": "云盘", - "version": "2.0.9", + "version": "2.1", "icon": "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/cloudassistant.png", "author": "thsrite", "level": 99, "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlgN7RtXlPNXoFE9B67ye\ny2mog/hDDrhBAIJogdvfAgBMZ1qVzIPcBfdjENPJ9kV/F+zOoh0CzEaDufM54ERT\nykK1pQw7yj7quRZDbv5byxVNqI8bJg8zQo8Q66SQ8SP+aftmpFrADKClQ8VcVYzZ\nJ+YDu9H9q+TcvBqVtLyKfAH5T9WAxn0bXEh4OgkJn7oO5eI5+Fsi6Aq9suVN/HyK\nz2bDr237GmXJT4YPn9s7kj4Rypzg2ldiuBwtVnaTw+xjZRlCRr4Gs0eFUIMUqnoQ\nip4Px8Mrq5cqHl0HrJ/av/pJLCN1icCgegYW63b2gjjJwmps9NGGOydRzgoFkqj0\nDwIDAQAB", "history": { + "v2.1": "修复strm生成", "v2.0.9": "修复未覆盖时删除监控文件", "v2.0.8": "修复通知", "v2.0.7": "修复通知标题", diff --git a/plugins/cloudassistant/__init__.py b/plugins/cloudassistant/__init__.py index a2373a4..1c338d3 100644 --- a/plugins/cloudassistant/__init__.py +++ b/plugins/cloudassistant/__init__.py @@ -64,7 +64,7 @@ class CloudAssistant(_PluginBase): # 插件图标 plugin_icon = "https://raw.githubusercontent.com/thsrite/MoviePilot-Plugins/main/icons/cloudassistant.png" # 插件版本 - plugin_version = "2.0.9" + plugin_version = "2.1" # 插件作者 plugin_author = "thsrite" # 作者主页 @@ -482,7 +482,7 @@ class CloudAssistant(_PluginBase): # 生成strm文件 retcode = self.__create_strm_file(mount_file=mount_file, mount_path=mount_path, - file_path=str(file_path), + target_file=target_return_file, library_dir=monitor_dir.get("library_dir"), cloud_type=monitor_dir.get("cloud_type"), cloud_path=monitor_dir.get("cloud_path"), @@ -816,7 +816,7 @@ class CloudAssistant(_PluginBase): return retcode, retmsg @staticmethod - def __create_strm_file(mount_file: str, mount_path: str, file_path: str, library_dir: str = None, + def __create_strm_file(mount_file: str, mount_path: str, target_file: str, library_dir: str = None, cloud_type: str = None, cloud_path: str = None, cloud_url: str = None, cloud_scheme: str = None): """ @@ -827,9 +827,9 @@ class CloudAssistant(_PluginBase): """ try: # 获取视频文件名和目录 - video_name = Path(mount_file).name + video_name = Path(target_file).name # 获取视频目录 - dest_path = Path(mount_file).parent + dest_path = Path(target_file).parent if not dest_path.exists(): logger.info(f"创建目标文件夹 {dest_path}") @@ -842,12 +842,12 @@ class CloudAssistant(_PluginBase): logger.info(f"strm文件已存在 {strm_path}") return - logger.info(f"替换前本地路径:::{mount_file}") + logger.info(f"替换前挂载云盘路径:::{mount_file}") # 云盘模式 if cloud_type: # 替换路径中的\为/ - dest_file = file_path.replace("\\", "/") + dest_file = mount_file.replace("\\", "/") dest_file = dest_file.replace(cloud_path, "") # 对盘符之后的所有内容进行url转码 dest_file = urllib.parse.quote(dest_file, safe='')