mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-06 16:07:01 +08:00
refactor: unify monitor history port access
This commit is contained in:
@@ -85,6 +85,11 @@ class TransferHistoryPort:
|
||||
return getattr(_get_transfer_history_writer(None), name)
|
||||
|
||||
|
||||
def get_transfer_history_port() -> TransferHistoryWriter:
|
||||
"""返回启动组合根登记的整理历史数据端口实例。"""
|
||||
return _get_transfer_history_writer(None)
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class HistoryMutationResult:
|
||||
"""描述历史记录维护操作是否成功及兼容提示。"""
|
||||
|
||||
@@ -9,9 +9,9 @@ from app.runtime.cache import TTLCache
|
||||
from app.application.directory import DirectoryHelper
|
||||
from app.application.history import (
|
||||
HistoryGateAction,
|
||||
TransferHistoryPort as TransferHistoryOper,
|
||||
describe_history_gate,
|
||||
evaluate_history_gate,
|
||||
get_transfer_history_port,
|
||||
is_skip_action,
|
||||
max_failed_retries,
|
||||
resolve_history,
|
||||
@@ -111,7 +111,7 @@ class TransferDispatcher:
|
||||
"""
|
||||
try:
|
||||
history = resolve_history(src_path, storage=storage,
|
||||
transfer_history_oper=TransferHistoryOper())
|
||||
transfer_history_oper=get_transfer_history_port())
|
||||
except Exception as err:
|
||||
logger.error(f"查询整理历史失败: {src_path} - {err}")
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user