Auto-generate OBS source names and improve stream list UI

- Remove manual OBS source name input from Add Stream form
- Auto-generate OBS source names using pattern: streamName_twitch
- Update security validation to exclude obs_source_name requirement
- Increase stream avatar size from 32px to 64px for better visibility
- Fix spacing issues between UI elements using explicit margins

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Decobus 2025-07-20 16:11:11 -04:00
parent 319bada9b7
commit ece75cf2df
3 changed files with 24 additions and 40 deletions

View file

@ -63,8 +63,13 @@ async function fetchTeamInfo(teamId: number) {
import { validateStreamInput } from '../../../lib/security';
// Generate OBS source name from stream name
function generateOBSSourceName(streamName: string): string {
return streamName.toLowerCase().replace(/\s+/g, '_') + '_twitch';
}
export async function POST(request: NextRequest) {
let name: string, obs_source_name: string, url: string, team_id: number;
let name: string, url: string, team_id: number, obs_source_name: string;
// Parse and validate request body
try {
@ -78,7 +83,10 @@ export async function POST(request: NextRequest) {
}, { status: 400 });
}
({ name, obs_source_name, url, team_id } = validation.data!);
({ name, url, team_id } = validation.data!);
// Auto-generate OBS source name from stream name
obs_source_name = generateOBSSourceName(name);
} catch {
return NextResponse.json({ error: 'Invalid JSON in request body' }, { status: 400 });