Files
radio-explorer/server/scripts/report-streams.js
Marco Mooren e0a60f7b64 Add player functionality with HLS support and API integration
- Implemented a new Player class in player.js to handle audio playback, including HLS support using hls.js.
- Created a shared API module in api.js for making HTTP requests with proper error handling.
- Added DOM utility functions in dom.js for creating and clearing elements.
- Introduced WebSocket connection handling in ws.js for real-time updates.
- Developed a comprehensive CSS stylesheet for styling the application, including a high-contrast theme.
2026-05-10 14:43:00 +02:00

13 lines
501 B
JavaScript

import 'dotenv/config';
import Database from 'better-sqlite3';
const db = new Database(process.env.DB_PATH || './data/db/oradio.sqlite');
const rows = db.prepare(`
SELECT s.name, st.format, st.url, st.last_status
FROM streams st JOIN stations s ON s.id = st.station_id
ORDER BY (st.last_status = 'up'), s.name
`).all();
for (const r of rows) {
const tag = r.last_status === 'up' ? 'OK ' : 'BAD';
console.log(tag, (r.last_status || '').padEnd(14), r.format.padEnd(5), r.name, '->', r.url);
}