✨ 修复一些bug

- 移除不必要的定时器类,简化代码结构
- 优化好友请求处理逻辑,确保在自动同意和手动处理之间的清晰区分
- 更新缓存机制,避免重复处理相同的好友请求
- 新增判断文件是否为二进制文件的功能,提升文件处理的准确性
- 优化缓存字典的过期检查逻辑,提高性能和可读性
This commit is contained in:
HibiKier
2025-08-18 21:00:32 +08:00
parent 11524bcb04
commit d6b687ceb0
3 changed files with 80 additions and 91 deletions
+19
View File
@@ -64,6 +64,25 @@ class ResourceDirManager:
cls.__tree_append(path, deep)
def is_binary_file(file_path: str) -> bool:
"""判断是否为二进制文件"""
binary_extensions = {
".jpg",
".jpeg",
".png",
".gif",
".bmp",
".ico",
".pdf",
".zip",
".rar",
".7z",
".exe",
".dll",
}
return any(file_path.lower().endswith(ext) for ext in binary_extensions)
def cn2py(word: str) -> str:
"""将字符串转化为拼音