镜像自地址
https://github.com/binary-husky/gpt_academic.git
已同步 2025-12-08 15:36:48 +00:00
比较提交
1 次代码提交
version3.5
...
version3.6
| 作者 | SHA1 | 提交日期 | |
|---|---|---|---|
|
|
b1be05009b |
11
toolbox.py
11
toolbox.py
@@ -544,13 +544,15 @@ def find_recent_files(directory):
|
|||||||
|
|
||||||
|
|
||||||
def file_already_in_downloadzone(file, user_path):
|
def file_already_in_downloadzone(file, user_path):
|
||||||
parent_path = user_path
|
try:
|
||||||
child_path = file
|
parent_path = os.path.abspath(user_path)
|
||||||
if os.path.commonpath([parent_path, child_path]) == parent_path:
|
child_path = os.path.abspath(file)
|
||||||
|
if os.path.samefile(os.path.commonpath([parent_path, child_path]), parent_path):
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
except:
|
||||||
|
return False
|
||||||
|
|
||||||
def promote_file_to_downloadzone(file, rename_file=None, chatbot=None):
|
def promote_file_to_downloadzone(file, rename_file=None, chatbot=None):
|
||||||
# 将文件复制一份到下载区
|
# 将文件复制一份到下载区
|
||||||
@@ -564,6 +566,7 @@ def promote_file_to_downloadzone(file, rename_file=None, chatbot=None):
|
|||||||
if file_already_in_downloadzone(file, user_path):
|
if file_already_in_downloadzone(file, user_path):
|
||||||
new_path = file
|
new_path = file
|
||||||
else:
|
else:
|
||||||
|
user_path = get_log_folder(user_name, plugin_name='downloadzone')
|
||||||
if rename_file is None: rename_file = f'{gen_time_str()}-{os.path.basename(file)}'
|
if rename_file is None: rename_file = f'{gen_time_str()}-{os.path.basename(file)}'
|
||||||
new_path = pj(user_path, rename_file)
|
new_path = pj(user_path, rename_file)
|
||||||
# 如果已经存在,先删除
|
# 如果已经存在,先删除
|
||||||
|
|||||||
在新工单中引用
屏蔽一个用户