From e7c580d3757cd6a8a086348a90475e05819ca7af Mon Sep 17 00:00:00 2001 From: jxxghp Date: Mon, 6 Jan 2025 10:28:26 +0800 Subject: [PATCH] fix #3646 --- app/modules/filemanager/storages/alist.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/modules/filemanager/storages/alist.py b/app/modules/filemanager/storages/alist.py index af411c27..cc4eadfb 100644 --- a/app/modules/filemanager/storages/alist.py +++ b/app/modules/filemanager/storages/alist.py @@ -553,7 +553,7 @@ class Alist(StorageBase, metaclass=Singleton): :param new_name: 上传后文件名 :param task: 是否为任务,默认为False避免未完成上传时对文件进行操作 """ - encoded_path = UrlUtils.quote(fileitem.path + path.name) + encoded_path = UrlUtils.quote((Path(fileitem.path) / path.name).as_posix()) headers = self.__get_header_with_token() headers.setdefault("Content-Type", "application/octet-stream") headers.setdefault("As-Task", str(task).lower()) @@ -569,7 +569,7 @@ class Alist(StorageBase, metaclass=Singleton): return new_item = self.get_item(Path(fileitem.path) / path.name) - if new_name and new_name != path.name: + if new_item and new_name and new_name != path.name: if self.rename(new_item, new_name): return self.get_item(Path(new_item.path).with_name(new_name))