mirror of
https://github.com/d0zingcat/MoviePilot-Plugins.git
synced 2026-05-23 23:16:49 +00:00
fix 插件API安全控制
This commit is contained in:
@@ -24,7 +24,7 @@ from app.db.downloadhistory_oper import DownloadHistoryOper
|
||||
from app.db.transferhistory_oper import TransferHistoryOper
|
||||
from app.log import logger
|
||||
from app.plugins import _PluginBase
|
||||
from app.schemas import Notification, NotificationType, TransferInfo
|
||||
from app.schemas import NotificationType, TransferInfo
|
||||
from app.schemas.types import EventType, MediaType, SystemConfigKey
|
||||
from app.utils.string import StringUtils
|
||||
from app.utils.system import SystemUtils
|
||||
@@ -59,7 +59,7 @@ class DirMonitor(_PluginBase):
|
||||
# 插件图标
|
||||
plugin_icon = "directory.png"
|
||||
# 插件版本
|
||||
plugin_version = "1.9"
|
||||
plugin_version = "2.0"
|
||||
# 插件作者
|
||||
plugin_author = "jxxghp"
|
||||
# 作者主页
|
||||
@@ -655,10 +655,12 @@ class DirMonitor(_PluginBase):
|
||||
}]
|
||||
return []
|
||||
|
||||
def sync(self) -> schemas.Response:
|
||||
def sync(self, apikey: str) -> schemas.Response:
|
||||
"""
|
||||
API调用目录同步
|
||||
"""
|
||||
if apikey != settings.API_TOKEN:
|
||||
return schemas.Response(success=False, message="API密钥错误")
|
||||
self.sync_all()
|
||||
return schemas.Response(success=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user