Some checks failed
Lint and Build / build (pull_request) Failing after 1m25s
- Add setScene API endpoint for OBS scene switching (1-Screen, 2-Screen, 4-Screen) - Add getCurrentScene API endpoint to fetch active OBS scene - Implement scene switching buttons in main UI with dynamic state tracking - Buttons change color and text based on current active scene - Glass morphism styling with Solarized Dark gradients - Real-time scene state synchronization with optimistic UI updates - Toast notifications for user feedback 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
30 lines
No EOL
903 B
TypeScript
30 lines
No EOL
903 B
TypeScript
import { NextResponse } from 'next/server';
|
|
import { getOBSClient } from '../../../lib/obsClient';
|
|
|
|
export async function GET() {
|
|
try {
|
|
const obsClient = await getOBSClient();
|
|
|
|
// Get the current program scene
|
|
const response = await obsClient.call('GetCurrentProgramScene');
|
|
const { currentProgramSceneName } = response;
|
|
|
|
console.log(`Current OBS scene: ${currentProgramSceneName}`);
|
|
|
|
return NextResponse.json({
|
|
success: true,
|
|
data: { sceneName: currentProgramSceneName },
|
|
message: 'Current scene retrieved successfully'
|
|
});
|
|
} catch (obsError) {
|
|
console.error('OBS WebSocket error:', obsError);
|
|
return NextResponse.json(
|
|
{
|
|
success: false,
|
|
error: 'Failed to get current scene from OBS',
|
|
details: obsError instanceof Error ? obsError.message : 'Unknown error'
|
|
},
|
|
{ status: 500 }
|
|
);
|
|
}
|
|
} |