pull/632/head
Mr Chen 6 months ago
parent 8df9799564
commit f9f074ef01
  1. 2
      web/core/mw.py
  2. 4
      web/utils/file.py

@ -546,6 +546,8 @@ def getFileStatsDesc(
filename: str | None = None, filename: str | None = None,
path: str | None = None, path: str | None = None,
): ):
if path is None or filename is None:
return ';;;;;'
try: try:
filename = filename.replace('//', '/') filename = filename.replace('//', '/')
stat = os.stat(filename) stat = os.stat(filename)

@ -295,7 +295,7 @@ def getAllDirList(path, page=1, size=10, order = '', search=None):
for dst_file in plist: for dst_file in plist:
if not os.path.exists(dst_file): if not os.path.exists(dst_file):
continue continue
stat = getFileStatsDesc(dst_file, path) stat = getFileStatsDesc(filename=dst_file, path=path)
if os.path.isdir(dst_file): if os.path.isdir(dst_file):
dirnames.append(stat) dirnames.append(stat)
else: else:
@ -343,7 +343,7 @@ def getDirList(path, page=1, size=10, order = '', search=None):
if not os.path.exists(abs_file): if not os.path.exists(abs_file):
continue continue
stats = getFileStatsDesc(abs_file, path) stats = getFileStatsDesc(filename=abs_file, path=path)
if os.path.isdir(abs_file): if os.path.isdir(abs_file):
dirnames.append(stats) dirnames.append(stats)
else: else:

Loading…
Cancel
Save