From 543f170c68b802b4645ad41ca37642343988ccdf Mon Sep 17 00:00:00 2001 From: thsrite Date: Wed, 31 Jul 2024 21:14:05 +0800 Subject: [PATCH] fix --- plugins/cloudsyncdel/__init__.py | 11 ++++++----- plugins/filesoftlink/__init__.py | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/plugins/cloudsyncdel/__init__.py b/plugins/cloudsyncdel/__init__.py index 0a1c71f..ba360bc 100644 --- a/plugins/cloudsyncdel/__init__.py +++ b/plugins/cloudsyncdel/__init__.py @@ -4,7 +4,7 @@ import time from pathlib import Path from app import schemas -from app.core.config import settings +from app.core.config import settings, Settings from app.core.event import eventmanager, Event from app.log import logger from app.plugins import _PluginBase @@ -170,10 +170,11 @@ class CloudSyncDel(_PluginBase): if cloud_file_flag and self._notify: if self._url: - RequestUtils().post(url=self._url, json={ - "path": str(media_path), - "type": "del" - }) + if not media_path.suffix or media_path.suffix in Settings.RMT_MEDIAEXT: + RequestUtils().post(url=self._url, json={ + "path": str(media_path), + "type": "del" + }) backrop_image = self.chain.obtain_specific_image( mediaid=tmdb_id, diff --git a/plugins/filesoftlink/__init__.py b/plugins/filesoftlink/__init__.py index 6d9ad42..cec0f99 100644 --- a/plugins/filesoftlink/__init__.py +++ b/plugins/filesoftlink/__init__.py @@ -15,7 +15,7 @@ from watchdog.observers import Observer from watchdog.observers.polling import PollingObserver from app import schemas -from app.core.config import settings +from app.core.config import settings, Settings from app.core.event import eventmanager, Event from app.log import logger from app.plugins import _PluginBase @@ -560,10 +560,11 @@ class FileSoftLink(_PluginBase): retcode, retmsg = SystemUtils.softlink(file_path, Path(target_file)) logger.info(f"创建媒体文件软连接 {str(file_path)} 到 {target_file} {retcode} {retmsg}") if self._url: - RequestUtils().post(url=self._url, json={ - "path": str(file_path), - "type": "add" - }) + if file_path.suffix in Settings.RMT_MEDIAEXT: + RequestUtils().post(url=self._url, json={ + "path": str(file_path), + "type": "add" + }) else: if self._copy_files: # 其他nfo、jpg等复制文件