From b6a76f6f7cc6784c6e8ca0a801098dc1955a4816 Mon Sep 17 00:00:00 2001 From: wumode Date: Thu, 4 Sep 2025 20:47:13 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(Alist):=20=E6=B7=BB=E5=8A=A0=5F=5Flen?= =?UTF-8?q?=5F=5F()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/modules/filemanager/storages/alist.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/modules/filemanager/storages/alist.py b/app/modules/filemanager/storages/alist.py index f302ff43..4f0031cd 100644 --- a/app/modules/filemanager/storages/alist.py +++ b/app/modules/filemanager/storages/alist.py @@ -615,6 +615,9 @@ class Alist(StorageBase, metaclass=WeakSingleton): self.uploaded_size = 0 self.file_size = file_path.stat().st_size + def __len__(self): + return self.file_size + def read(self, size=-1): if global_vars.is_transfer_stopped(path.as_posix()): logger.info(f"【OpenList】{path} 上传已取消!") From 6c10defaa127f5fd6e4e54e34358c2ea8433d148 Mon Sep 17 00:00:00 2001 From: wumode Date: Thu, 4 Sep 2025 21:08:25 +0800 Subject: [PATCH 2/2] fix(Alist): add type hints --- app/modules/filemanager/storages/alist.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/modules/filemanager/storages/alist.py b/app/modules/filemanager/storages/alist.py index 4f0031cd..250da720 100644 --- a/app/modules/filemanager/storages/alist.py +++ b/app/modules/filemanager/storages/alist.py @@ -615,7 +615,7 @@ class Alist(StorageBase, metaclass=WeakSingleton): self.uploaded_size = 0 self.file_size = file_path.stat().st_size - def __len__(self): + def __len__(self) -> int: return self.file_size def read(self, size=-1):