mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-11-01 04:47:03 +08:00
refactor(types): govern plugin monitor candidate contracts
This commit is contained in:
@@ -6,13 +6,13 @@ import threading
|
||||
import time
|
||||
from collections.abc import Callable
|
||||
from pathlib import Path
|
||||
from typing import Any, Optional
|
||||
from typing import Any, Optional, cast
|
||||
|
||||
FederatedChangeResolver = Callable[[Path], Optional[tuple[str, Optional[dict], bool]]]
|
||||
FederatedChangeResolver = Callable[[Path], Optional[tuple[str, Optional[dict[str, Any]], bool]]]
|
||||
RuntimePluginResolver = Callable[[Path], Optional[str]]
|
||||
MonitorSuppression = Callable[[str], bool]
|
||||
LocalCandidateResolver = Callable[[Path], Optional[dict]]
|
||||
LocalPluginSync = Callable[[str, Optional[dict]], bool]
|
||||
LocalCandidateResolver = Callable[[Path], Optional[dict[str, Any]]]
|
||||
LocalPluginSync = Callable[[str, Optional[dict[str, Any]]], bool]
|
||||
PluginReloader = Callable[[str], Any]
|
||||
DependencyManifestStatus = Callable[[Path], Optional[bool]]
|
||||
WatchFunction = Callable[..., Any]
|
||||
@@ -225,7 +225,8 @@ class PluginChangeMonitor:
|
||||
f"但跳过同步:{candidate.get('skip_reason')}"
|
||||
)
|
||||
continue
|
||||
local_plugins_to_sync[candidate.get("id")] = (
|
||||
# 本地市场候选的 id 来自仓库索引的插件标识。
|
||||
local_plugins_to_sync[cast(str, candidate.get("id"))] = (
|
||||
candidate,
|
||||
event_path,
|
||||
True,
|
||||
|
||||
1
mypy.ini
1
mypy.ini
@@ -64,6 +64,7 @@ files =
|
||||
app/runtime/extensions/plugin/system.py,
|
||||
app/runtime/extensions/plugin/sync.py,
|
||||
app/runtime/extensions/plugin/paths.py,
|
||||
app/runtime/extensions/plugin/monitor.py,
|
||||
app/runtime/extensions/service.py,
|
||||
app/runtime/compat/diagnostics.py,
|
||||
app/runtime/compat/manifest.py,
|
||||
|
||||
Reference in New Issue
Block a user