-
Notifications
You must be signed in to change notification settings - Fork 3
Labels
claudeIssues created by ClaudeIssues created by Claude
Description
Issue Description
The application throws an AttributeError when accessing the /api/v1/show/character/stats endpoint.
Error Traceback
[E 260106 11:38:08 web:1945] Uncaught exception GET /api/v1/show/character/stats (::1)
HTTPServerRequest(protocol='http', host='localhost:8080', method='GET', uri='/api/v1/show/character/stats', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "/Users/tim/.pyenv/versions/venv313-digiscript/lib/python3.13/site-packages/tornado/web.py", line 1859, in _execute
result = await result
^^^^^^^^^^^^
File "/Users/tim/Documents/Code/DigiScript/server/controllers/api/show/characters.py", line 201, in get
if line.stage_direction:
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'ScriptLine' object has no attribute 'stage_direction'
Root Cause
The stage_direction boolean field was removed from the ScriptLine model in commit 08b6424 and replaced with a line_type enum field (supporting DIALOGUE, STAGE_DIRECTION, CUE_LINE, SPACING types).
However, several files still reference the old stage_direction attribute:
Production Code
/server/controllers/api/show/characters.pyline 201/server/controllers/api/show/cast.pyline 189/server/utils/show/mic_assignment.pyline 127
Test Code
/server/test/utils/show/test_mic_assignment.py(multiple lines)
Impact
- Character statistics endpoint crashes
- Cast statistics endpoint likely crashes
- Microphone auto-assignment may fail
Solution
Replace all instances of if line.stage_direction: with if line.line_type != ScriptLineType.DIALOGUE: to properly check for non-dialogue line types.
Metadata
Metadata
Assignees
Labels
claudeIssues created by ClaudeIssues created by Claude