修复 目录监控无法触发蓝光原盘整理

This commit is contained in:
景大侠
2026-01-13 00:09:34 +08:00
parent 2211f8d9e4
commit 294bb3d4a1
+11 -2
View File
@@ -695,11 +695,13 @@ class Monitor(ConfigReloadMixin, metaclass=SingletonClass):
# 全程加锁 # 全程加锁
with lock: with lock:
is_bluray_folder = False
# 蓝光原盘文件处理 # 蓝光原盘文件处理
if __is_bluray_sub(event_path): if __is_bluray_sub(event_path):
event_path = __get_bluray_dir(event_path) event_path = __get_bluray_dir(event_path)
if not event_path: if not event_path:
return return
is_bluray_folder = True
# TTL缓存控重 # TTL缓存控重
if self._cache.get(str(event_path)): if self._cache.get(str(event_path)):
@@ -708,13 +710,20 @@ class Monitor(ConfigReloadMixin, metaclass=SingletonClass):
self._cache[str(event_path)] = True self._cache[str(event_path)] = True
try: try:
if is_bluray_folder:
logger.info(f"开始整理蓝光原盘: {event_path}")
else:
logger.info(f"开始整理文件: {event_path}") logger.info(f"开始整理文件: {event_path}")
# 开始整理 # 开始整理
TransferChain().do_transfer( TransferChain().do_transfer(
fileitem=FileItem( fileitem=FileItem(
storage=storage, storage=storage,
path=event_path.as_posix(), path=(
type="file", event_path.as_posix()
if not is_bluray_folder
else event_path.as_posix() + "/"
),
type="file" if not is_bluray_folder else "dir",
name=event_path.name, name=event_path.name,
basename=event_path.stem, basename=event_path.stem,
extension=event_path.suffix[1:], extension=event_path.suffix[1:],