mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-04-05 11:47:50 +08:00
Merge pull request #2911 from thsrite/v2
This commit is contained in:
@@ -149,14 +149,17 @@ class Monitor(metaclass=Singleton):
|
||||
if mon_dir.storage == "local":
|
||||
# 本地目录监控
|
||||
try:
|
||||
observer = self.__choose_observer()
|
||||
if mon_dir.monitor_mode == "fast":
|
||||
observer = self.__choose_observer()
|
||||
else:
|
||||
observer = PollingObserver()
|
||||
self._observers.append(observer)
|
||||
observer.schedule(FileMonitorHandler(mon_path=mon_path, callback=self),
|
||||
path=mon_path,
|
||||
path=str(mon_path),
|
||||
recursive=True)
|
||||
observer.daemon = True
|
||||
observer.start()
|
||||
logger.info(f"已启动 {mon_path} 的目录监控服务")
|
||||
logger.info(f"已启动 {mon_path} 的目录监控服务, 监控模式:{mon_dir.monitor_mode}")
|
||||
except Exception as e:
|
||||
err_msg = str(e)
|
||||
if "inotify" in err_msg and "reached" in err_msg:
|
||||
|
||||
@@ -113,6 +113,8 @@ class TransferDirectoryConf(BaseModel):
|
||||
download_category_folder: Optional[bool] = False
|
||||
# 监控方式 downloader/monitor,None为不监控
|
||||
monitor_type: Optional[str] = None
|
||||
# 监控模式 fast / compatibility
|
||||
monitor_mode: Optional[str] = 'fast'
|
||||
# 整理方式 move/copy/link/softlink
|
||||
transfer_type: Optional[str] = None
|
||||
# 文件覆盖模式 always/size/never/latest
|
||||
|
||||
Reference in New Issue
Block a user