feat: enhance emotion handling in audiobook segments and UI for multi-emotion selection

This commit is contained in:
2026-03-13 14:39:51 +08:00
parent 16947d6b8b
commit 161e7fa76d
4 changed files with 37 additions and 23 deletions

View File

@@ -16,7 +16,7 @@ from db.models import AudiobookProject, AudiobookCharacter, User
logger = logging.getLogger(__name__)
_LINE_RE = re.compile(r'^【(.+?)】(.*)$')
_EMO_RE = re.compile(r'(开心|愤怒|悲伤|恐惧|厌恶|低沉|惊讶):([0-9.]+)\s*$')
_EMO_RE = re.compile(r'([^:]+):([0-9.]+)\s*$')
# Cancellation events for batch operations, keyed by project_id
_cancel_events: dict[int, asyncio.Event] = {}