Merge branch 'Mai-with-u:dev' into dev

This commit is contained in:
Dawn ARC
2026-05-08 21:32:38 +08:00
committed by GitHub
12 changed files with 58 additions and 36 deletions

View File

@@ -56,7 +56,7 @@ BOT_CONFIG_PATH: Path = (CONFIG_DIR / "bot_config.toml").resolve().absolute()
MODEL_CONFIG_PATH: Path = (CONFIG_DIR / "model_config.toml").resolve().absolute()
LEGACY_ENV_PATH: Path = (PROJECT_ROOT / ".env").resolve().absolute()
A_MEMORIX_LEGACY_CONFIG_PATH: Path = (CONFIG_DIR / "a_memorix.toml").resolve().absolute()
MMC_VERSION: str = "1.0.0-pre.15"
MMC_VERSION: str = "1.0.0-pre.16"
CONFIG_VERSION: str = "8.10.15"
MODEL_CONFIG_VERSION: str = "1.16.1"

View File

@@ -388,7 +388,6 @@ class EmojiManager:
if existing_record := session.exec(statement).first():
existing_record.full_path = str(emoji.full_path)
existing_record.no_file_flag = False
existing_record.is_banned = False
existing_record.last_used_time = datetime.now()
existing_record.query_count += 1
session.add(existing_record)
@@ -473,7 +472,6 @@ class EmojiManager:
image_record.full_path = str(new_emoji.full_path)
image_record.description = new_emoji.description
image_record.no_file_flag = False
image_record.is_banned = False
session.add(image_record)
except Exception as exc:
logger.error(f"Update cached emoji description failed: {exc}")
@@ -531,6 +529,9 @@ class EmojiManager:
statement = select(Images).filter_by(image_hash=emoji.file_hash, image_type=ImageType.EMOJI).limit(1)
existing_record = session.exec(statement).first()
if existing_record:
if existing_record.is_banned:
logger.info(f"[register_emoji] Emoji is banned, skipping: {emoji.file_hash}")
return "skipped"
if existing_record.is_registered and _is_available_emoji_record(existing_record):
# logger.info(f"[register_emoji] Emoji already registered, skipping: {emoji.file_hash}")
return "skipped"
@@ -1085,6 +1086,10 @@ class EmojiManager:
return "failed"
if existing_record is not None:
if existing_record.is_banned:
logger.info(f"[register_emoji] Emoji is banned, skipping: {target_emoji.file_name}")
return "skipped"
if existing_record.is_registered and _is_available_emoji_record(existing_record):
logger.info(f"[register_emoji] Emoji already registered, skipping: {target_emoji.file_name}")
return "skipped"