Add system scene exclusion list to prevent infrastructure scenes from showing as orphaned
All checks were successful
Lint and Build / build (pull_request) Successful in 2m54s

- Added SYSTEM_SCENES array with hardcoded list of infrastructure scenes
- Updated orphaned groups detection to exclude these system scenes
- Prevents scenes containing source switchers from being flagged as orphaned
- Includes common infrastructure scenes: 1-Screen, 2-Screen, 4-Screen, Starting, Ending, Audio, Movies

This ensures that OBS infrastructure scenes are not managed by the app and won't show up as orphaned groups in the UI.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Decobus 2025-07-20 22:40:47 -04:00
parent b5933fc6bb
commit 43ce6534a5

View file

@ -3,6 +3,18 @@ import { getDatabase } from '../../../lib/database';
import { TABLE_NAMES } from '../../../lib/constants';
import { getOBSClient } from '../../../lib/obsClient';
// System scenes that should not be considered orphaned
// These are infrastructure scenes that contain source switchers or other system components
const SYSTEM_SCENES: string[] = [
'1-Screen',
'2-Screen',
'4-Screen',
'Starting',
'Ending',
'Audio',
'Movies'
];
interface OBSScene {
sceneName: string;
sceneUuid: string;
@ -70,7 +82,8 @@ export async function GET() {
missing_in_obs: verification.filter(team => !team.exists_in_obs),
name_mismatches: verification.filter(team => team.name_changed),
orphaned_in_obs: obsScenes.filter(scene =>
!teams.some(team => team.group_uuid === scene.sceneUuid || team.group_name === scene.sceneName)
!teams.some(team => team.group_uuid === scene.sceneUuid || team.group_name === scene.sceneName) &&
!SYSTEM_SCENES.includes(scene.sceneName)
).map(s => ({ name: s.sceneName, uuid: s.sceneUuid }))
}
});