Fix OBS group creation by using nested scenes
- Remove invalid CreateGroup API calls (not supported in OBS WebSocket v5) - Implement nested scenes approach for stream grouping - Create a separate scene for each stream containing browser source and text overlay - Add nested scene to team scene to simulate group behavior - Fix lint errors and remove unused imports 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
78f4d325d8
commit
caca548c45
2 changed files with 60 additions and 59 deletions
|
@ -1,6 +1,6 @@
|
|||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import { getDatabase } from '../../../lib/database';
|
||||
import { connectToOBS, getOBSClient, disconnectFromOBS, addSourceToSwitcher, createGroupIfNotExists, addSourceToGroup, createStreamGroup } from '../../../lib/obsClient';
|
||||
import { connectToOBS, getOBSClient, disconnectFromOBS, addSourceToSwitcher, createStreamGroup } from '../../../lib/obsClient';
|
||||
import { open } from 'sqlite';
|
||||
import sqlite3 from 'sqlite3';
|
||||
import path from 'path';
|
||||
|
@ -131,7 +131,7 @@ export async function POST(request: NextRequest) {
|
|||
|
||||
if (!sourceExists) {
|
||||
// Create stream group with text overlay
|
||||
const result = await createStreamGroup(groupName, name, teamInfo.team_name, url);
|
||||
await createStreamGroup(groupName, name, teamInfo.team_name, url);
|
||||
|
||||
// Update team with group UUID if not set
|
||||
if (!teamInfo.group_uuid) {
|
||||
|
@ -152,7 +152,7 @@ export async function POST(request: NextRequest) {
|
|||
// Get the scene UUID for the group
|
||||
const obsClient = await getOBSClient();
|
||||
const { scenes } = await obsClient.call('GetSceneList');
|
||||
const scene = scenes.find((s: any) => s.sceneName === groupName);
|
||||
const scene = scenes.find((s: { sceneName: string; sceneUuid: string }) => s.sceneName === groupName);
|
||||
|
||||
if (scene) {
|
||||
await db.run(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue