Skip to content

Conversation

@Tim020
Copy link
Contributor

@Tim020 Tim020 commented Jan 6, 2026

Summary

This PR fixes legacy code that still referenced the removed stage_direction boolean field after the migration to the line_type enum in commit 08b6424.

Changes Made

Updated 4 files that were still using if line.stage_direction: checks:

  1. server/controllers/api/show/characters.py (line 201)

    • Added ScriptLineType import
    • Replaced boolean check with line_type != ScriptLineType.DIALOGUE
  2. server/controllers/api/show/cast.py (line 189)

    • Added ScriptLineType import
    • Replaced boolean check with line_type != ScriptLineType.DIALOGUE
  3. server/utils/show/mic_assignment.py (line 127)

    • Added ScriptLineType import
    • Replaced boolean check with line_type != ScriptLineType.DIALOGUE
  4. server/test/utils/show/test_mic_assignment.py (multiple lines)

    • Added ScriptLineType import
    • Updated mock objects to use line_type instead of stage_direction

Why != DIALOGUE instead of == STAGE_DIRECTION?

Using != DIALOGUE correctly filters out ALL non-dialogue line types:

  • Stage directions
  • Cue lines (new in the refactor)
  • Spacing lines (new in the refactor)

This makes the code more future-proof and semantically accurate.

Test Plan

  • All 23 tests in test_mic_assignment.py pass
  • API endpoint /api/v1/show/character/stats works without errors
  • API endpoint /api/v1/show/cast/stats should work without errors

Related Issues

Fixes #812

🤖 Generated with Claude Code

@github-actions github-actions bot added large-diff server Pull requests changing back end code labels Jan 6, 2026
@Tim020 Tim020 added the claude Issues created by Claude label Jan 6, 2026
@github-actions
Copy link

github-actions bot commented Jan 6, 2026

Python Test Results

  1 files    1 suites   17s ⏱️
220 tests 220 ✅ 0 💤 0 ❌
225 runs  225 ✅ 0 💤 0 ❌

Results for commit 7517332.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

Client Test Results

34 tests   34 ✅  0s ⏱️
 1 suites   0 💤
 1 files     0 ❌

Results for commit 7517332.

♻️ This comment has been updated with latest results.

The stage_direction boolean field was removed in commit 08b6424 and
replaced with the line_type enum. Updated 3 production files and 1 test
file that still referenced the old attribute.

Changed all instances of `if line.stage_direction:` to
`if line.line_type != ScriptLineType.DIALOGUE:` to properly filter
out non-dialogue lines (stage directions, cue lines, and spacing).

Files modified:
- server/controllers/api/show/characters.py (line 201)
- server/controllers/api/show/cast.py (line 189)
- server/utils/show/mic_assignment.py (line 127)
- server/test/utils/show/test_mic_assignment.py (multiple mocks)

Fixes #812

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@Tim020 Tim020 force-pushed the issue/stage-direction-hangover branch from ee8b8a1 to ab26331 Compare January 6, 2026 12:48
@github-actions github-actions bot added small-diff Small pull request and removed large-diff labels Jan 6, 2026
@Tim020 Tim020 linked an issue Jan 6, 2026 that may be closed by this pull request
@Tim020 Tim020 enabled auto-merge (squash) January 6, 2026 12:52
@Tim020 Tim020 merged commit 4d72aec into dev Jan 6, 2026
14 checks passed
@Tim020 Tim020 deleted the issue/stage-direction-hangover branch January 6, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude Issues created by Claude server Pull requests changing back end code small-diff Small pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AttributeError: 'ScriptLine' object has no attribute 'stage_direction'

2 participants