fix: 回滚文件名编解码返回逻辑以修复直接出现 unicode 的问题 (#1325)

This commit is contained in:
ZXGU183 authored and GitHub committed 2025-06-21 08:32:15 +00:00
1 parent d7573c68c7
commit e26668bebe
2 files changed
+4 -10

No files matched your search

-6
View File
@@ -1,6 +0,0 @@
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
}
+4 -4
View File
@@ -372,7 +372,7 @@ class DownloadBase(ABC):
end_time = time.localtime()
self.download_cover(
time.strftime(self.gen_download_filename(), end_time if end_time else time.localtime()
time.strftime(self.gen_download_filename().encode("unicode-escape").decode(), end_time if end_time else time.localtime()
).encode().decode("unicode-escape"))
# 更新数据库中封面存储路径
with SessionLocal() as db:
@@ -495,9 +495,9 @@ class DownloadBase(ABC):
if os.path.exists(f"{fmt_file_name}.{self.suffix}"):
file_time += 1
else:
filename = fmt_file_name
break
return filename.encode("unicode-escape").decode()
return fmt_file_name
else:
return filename
@staticmethod
def download_file_rename(old_file_name, file_name):