Fix getActive API to use standardized response format

- Update /api/getActive to return { success: true, data: {...} } format
- Add proper error handling with standardized error responses
- Update main page to handle new response format for active sources
- Remove unused variables and clean up code
- Add trim() to file reads to handle whitespace properly

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Decobus 2025-07-22 15:04:08 -04:00
parent 8c2de2c66b
commit 5dd9707f13
2 changed files with 24 additions and 35 deletions

View file

@ -81,7 +81,7 @@ export default function Home() {
]);
setStreams(streamsData.data);
setActiveSources(activeData);
setActiveSources(activeData.data);
} catch (error) {
console.error('Error fetching data:', error);
showError('Failed to Load Data', 'Could not fetch streams. Please refresh the page.');