$ show Billos/Broadcastarr
Broadcastarr is a media broadcasting service that scrapes broadcast schedules from websites, processes and stores broadcast information, and publishes notifications to platforms like Discord and Gotify. It integrates with media servers (Jellyfin) to make content available as M3U8 streams. The architecture consists of a monolithic application with separate server (API), worker (background tasks), and bootstrap (initialization) components. It uses Agenda for job scheduling, Mongoose for MongoDB ODM, Puppeteer for web scraping, Express for API server, and Discord.js for bot functionality. The system provides a REST API for monitoring and control, along with Discord slash commands for management.
The LLM identified 5 files worth highlighting for reuse:
Provides safe asynchronous wrappers for file system operations (saveFile, removeFile, fileExists, emptyFolder, checkImageExists, getImage) with proper error handling and logging. Extractable as a standalone utility module with minimal dependencies (only fs/path and logger).
Constructs API URLs by joining path segments with proper URI encoding and appending API key as query parameter. Handles edge cases like encoding special characters in paths. Demonstrates careful attention to URL construction security and correctness.
Converts JavaScript Date objects to emoji-based time representations (e.g., '14:30' becomes '🔟🔟:🔟🔟'). Uses a mapping dictionary for digit-to-emoji conversion and handles time formatting with Luxon. Shows creative problem-solving for visual time representation in Discord messages.
Extends Nunjucks environment with custom globals (dateToFormat, now) and filters (formatDate) for date manipulation. Provides safe template rendering with proper error handling and logging. Demonstrates thoughtful extension of a templating engine for domain-specific needs.
Manages a single UUID document in MongoDB with functions to get, await, and remove the UUID. Implements a polling await pattern for UUID initialization in worker processes. Shows careful consideration of distributed system initialization patterns.