fix Windows下获取目录问题

This commit is contained in:
mayun110 2023-09-09 17:49:40 +08:00
parent 27238ac467
commit 3914ff4dd6

View File

@ -1,3 +1,4 @@
import platform
import re
import shutil
import threading
@ -122,7 +123,15 @@ class DirMonitor(_PluginBase):
continue
# 存储目的目录
paths = mon_path.split(":")
system = platform.system()
if system == "Windows":
if mon_path.count(":") > 1:
paths = [mon_path.split(":")[0] + ":" + mon_path.split(":")[1],
mon_path.split(":")[2] + ":" + mon_path.split(":")[3]]
else:
paths = [mon_path]
else:
paths = mon_path.split(":")
target_path = None
if len(paths) > 1:
mon_path = paths[0]