diff --git a/logs/all.log b/logs/all.log index b575295..4954ad4 100644 --- a/logs/all.log +++ b/logs/all.log @@ -1,3 +1,6 @@ 2025-01-06 16:17:49.810 |INFO | funbuild.core.core : core: 81 | funbuild | - fundrive build 2025-01-06 16:17:49.814 |INFO | funbuild.core.core : core: 69 | funbuild | - fundrive pull 2025-01-06 16:17:58.182 |INFO | funbuild.core.core : core: 73 | funbuild | - fundrive push +2025-01-06 23:22:56.994 |INFO | funbuild.core.core : core: 81 | funbuild | - fundrive build +2025-01-06 23:22:56.995 |INFO | funbuild.core.core : core: 69 | funbuild | - fundrive pull +2025-01-06 23:23:05.137 |INFO | funbuild.core.core : core: 73 | funbuild | - fundrive push diff --git a/logs/funbuild.log b/logs/funbuild.log index b575295..4954ad4 100644 --- a/logs/funbuild.log +++ b/logs/funbuild.log @@ -1,3 +1,6 @@ 2025-01-06 16:17:49.810 |INFO | funbuild.core.core : core: 81 | funbuild | - fundrive build 2025-01-06 16:17:49.814 |INFO | funbuild.core.core : core: 69 | funbuild | - fundrive pull 2025-01-06 16:17:58.182 |INFO | funbuild.core.core : core: 73 | funbuild | - fundrive push +2025-01-06 23:22:56.994 |INFO | funbuild.core.core : core: 81 | funbuild | - fundrive build +2025-01-06 23:22:56.995 |INFO | funbuild.core.core : core: 69 | funbuild | - fundrive pull +2025-01-06 23:23:05.137 |INFO | funbuild.core.core : core: 73 | funbuild | - fundrive push diff --git a/pyproject.toml b/pyproject.toml index 51eb718..13b2f00 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "fundrive" -version = "1.2.100" +version = "1.2.101" description = "fundrive" readme = "README.md" requires-python = ">=3.8" diff --git a/src/fundrive/drives/webdav/drive.py b/src/fundrive/drives/webdav/drive.py index 3f0c62b..dcb4262 100644 --- a/src/fundrive/drives/webdav/drive.py +++ b/src/fundrive/drives/webdav/drive.py @@ -33,6 +33,10 @@ def login( return True def mkdir(self, fid, name, return_if_exist=True, *args, **kwargs) -> str: + dir_map = dict([(file.name, file.fid) for file in self.get_dir_list(fid=fid)]) + if name in dir_map: + logger.info(f"name={name} exists, return fid={fid}") + return dir_map[name] path = str(os.path.join(fid, name)) self.drive.mkdir(path=path) return path diff --git a/uv.lock b/uv.lock index e1833ab..8526a14 100644 --- a/uv.lock +++ b/uv.lock @@ -451,7 +451,7 @@ wheels = [ [[package]] name = "fundrive" -version = "1.2.100" +version = "1.2.101" source = { virtual = "." } dependencies = [ { name = "funget" },