fix: some error

This commit is contained in:
Lan
2025-12-01 11:30:52 +08:00
parent d96fa6ecc8
commit 4f10c0800b
7 changed files with 39 additions and 25 deletions
+8 -4
View File
@@ -123,10 +123,14 @@ class LocalFileClass:
def __init__(self, file):
self.file = file
self.path = data_root / "local" / file
self.ctime = time.strftime(
"%Y-%m-%d %H:%M:%S", time.localtime(os.path.getctime(self.path))
)
self.size = os.path.getsize(self.path)
if os.path.exists(self.path):
self.ctime = time.strftime(
"%Y-%m-%d %H:%M:%S", time.localtime(os.path.getctime(self.path))
)
self.size = os.path.getsize(self.path)
else:
self.ctime = None
self.size = None
async def read(self):
return open(self.path, "rb")