Skip to content

Commit

Permalink
Merge pull request #659 from midoks/dev
Browse files Browse the repository at this point in the history
文件大小功能优化
  • Loading branch information
midoks authored Dec 19, 2024
2 parents f5eacd6 + d691862 commit a581b7c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions plugins/clean/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def initConf():
"/www/server/redis/data",
"/www/server/alist/data/log",
"/www/server/dztasks/logs",
"/www/server/rsyncd/lsyncd.log"
"/www/server/cron",
]
for i in clogcom:
Expand Down
2 changes: 1 addition & 1 deletion plugins/tgbot/startup/extend/push_ad.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def send_msg(bot, tag='ad', trigger_time=300):
# TTKCDN 无视移动墙/GFW/SNI阻断 TG第一性价比 | 10/m | @ssdpflood
# https://t.me/gjgzs2022 | 22/m | @GJ_gzs
# 综合包网/NG接口开户 | 28/m | 6m | next,4/28 | x
# 实名认证/过人脸🕵️‍♀️各种账号处理✅ | 30/m| next,12/30 | @nngzs
# 实名认证/过人脸🕵️‍♀️各种账号处理✅ | 30/m| next,6/30 | @nngzs
# 桃花资源采集| 13/m| next,1/13 | @xiaolizi1122
keyboard = [
[
Expand Down
2 changes: 1 addition & 1 deletion plugins/tgbot/startup/extend/push_notice_msg.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def send_msg(bot, tag='ad', trigger_time=300):
# TTKCDN | 10/m | @ssdpflood | 5
# https://t.me/gjgzs2022 | 22/m | @GJ_gzs
# 综合包网/NG接口开户 | 28/m | 6m | next,4/28 | x
# 实名认证/过人脸🕵️‍♀️各种账号处理✅ | 30/m| next,12/30 | @nngzs
# 实名认证/过人脸🕵️‍♀️各种账号处理✅ | 30/m| next,6/30 | @nngzs
# 桃花资源采集| 13/m| next,1/13 | @xiaolizi1122
keyboard = [
[
Expand Down
6 changes: 4 additions & 2 deletions web/admin/files/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,10 @@ def create_dir():
@panel_login_required
def get_dir_size():
path = request.form.get('path', '')
size = file.getDirSize(path)
return mw.returnData(True, mw.toSize(size))
size = file.getDirSizeByBash(path)
return mw.returnData(True, size)
# size = file.getDirSize(path)
# return mw.returnData(True, mw.toSize(size))


# 删除文件
Expand Down
5 changes: 4 additions & 1 deletion web/utils/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,10 @@ def checkFileName(filename):
def getDirSize(filePath, size=0):
for root, dirs, files in os.walk(filePath):
for f in files:
size += os.path.getsize(os.path.join(root, f))
try:
size += os.path.getsize(os.path.join(root, f))
except Exception as e:
pass
# print(f)
return size

Expand Down

0 comments on commit a581b7c

Please sign in to comment.