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