mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 15:38:19 +08:00
refactor: 收口 V3 分层架构与插件兼容边界
This commit is contained in:
@@ -41,6 +41,10 @@ class SiteMutationRepository(Protocol):
|
||||
"""暂存一组站点优先级变更。"""
|
||||
...
|
||||
|
||||
async def stage_reset(self) -> None:
|
||||
"""暂存清空全部站点。"""
|
||||
...
|
||||
|
||||
|
||||
SiteIndexerLoader = Callable[[str], Awaitable[Optional[dict]]]
|
||||
SiteEventPublisher = Callable[[dict], Awaitable[None]]
|
||||
@@ -133,6 +137,13 @@ class SiteMutationCommand:
|
||||
await self._publish_deleted({"site_id": site_id})
|
||||
return SiteMutationResult(True)
|
||||
|
||||
async def reset(self) -> SiteMutationResult:
|
||||
"""清空全部站点,并在提交后发布通配站点删除事件。"""
|
||||
await self._repository.stage_reset()
|
||||
await self._commit()
|
||||
await self._publish_deleted({"site_id": "*"})
|
||||
return SiteMutationResult(True)
|
||||
|
||||
async def _commit(self) -> None:
|
||||
"""提交当前站点事务,失败时回滚并保留原始异常。"""
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user