Update files_api.py

This commit is contained in:
midoks 2022-12-06 20:37:07 +08:00
parent 7f2f307131
commit c4bb20ed54
1 changed files with 2 additions and 4 deletions

View File

@ -931,6 +931,7 @@ class files_api:
return mw.getJson(data)
def __get_stats(self, filename, path=None):
filename = filename.replace('//', '/')
try:
stat = os.stat(filename)
accept = str(oct(stat.st_mode)[-3:])
@ -947,11 +948,8 @@ class files_api:
if path:
tmp_path = (path + '/').replace('//', '/')
if tmp_path != '/':
filename = filename.replace(tmp_path, '', 1)
filename = filename.replace(tmp_path, '', 1)
filename = filename.replace('//', '/')
filename = filename.replace('/', '')
return filename + ';' + size + ';' + mtime + ';' + accept + ';' + user + ';' + link
except Exception as e:
# print(e)