🤖 自动格式化代码 [skip ci]
This commit is contained in:
@@ -376,7 +376,7 @@ class EmojiManager:
|
||||
self.emoji_num -= 1
|
||||
removed_count += 1
|
||||
continue
|
||||
|
||||
|
||||
if emoji.description == None:
|
||||
logger.warning(f"[检查] 表情包文件已被删除: {emoji.path}")
|
||||
# 执行表情包对象的删除方法
|
||||
@@ -762,7 +762,7 @@ class EmojiManager:
|
||||
await new_emoji.initialize_hash_format()
|
||||
emoji_base64 = image_path_to_base64(os.path.join(EMOJI_DIR, filename))
|
||||
description, emotions = await self.build_emoji_description(emoji_base64)
|
||||
if description == "" or description == None :
|
||||
if description == "" or description == None:
|
||||
return False
|
||||
new_emoji.description = description
|
||||
new_emoji.emotion = emotions
|
||||
@@ -836,11 +836,11 @@ class EmojiManager:
|
||||
"""
|
||||
# 获取所有表情包路径
|
||||
emoji_paths = {emoji.path for emoji in emoji_objects}
|
||||
|
||||
|
||||
# 遍历文件夹中的所有文件
|
||||
for file_name in os.listdir(emoji_dir):
|
||||
file_path = os.path.join(emoji_dir, file_name)
|
||||
|
||||
|
||||
# 检查文件是否在表情包路径列表中
|
||||
if file_path not in emoji_paths:
|
||||
try:
|
||||
@@ -851,6 +851,5 @@ class EmojiManager:
|
||||
logger.error(f"[错误] 删除文件时出错: {str(e)}")
|
||||
|
||||
|
||||
|
||||
# 创建全局单例
|
||||
emoji_manager = EmojiManager()
|
||||
|
||||
Reference in New Issue
Block a user