$ show toddrob99/searcharr
Searcharr is a Telegram bot application that interfaces with Sonarr and Radarr media management services. It allows users to authenticate, search for movies/TV shows, and add them to their media libraries through Telegram commands. The application features a modular architecture with separate layers for API communication, command handling, callback processing, and utilities. It includes robust authentication, conversation management for multi-step interactions, and internationalization support.
The LLM identified 4 files worth highlighting for reuse:
A robust base API client that handles version discovery between legacy and v3 APIs for Sonarr/Radarr, automatic endpoint formatting, and caching of commonly used data (quality profiles, root folders). Demonstrates good error handling, logging, and separation of concerns. Could be reused for any REST API with versioning concerns.
A self-contained conversation management system using SQLite to track multi-step interactions. Handles unique ID generation, storage/retrieval of conversation data and additional parameters, and cleanup. Demonstrates proper database locking, connection management, and transaction handling. Could be extracted for any bot or application requiring stateful interactions.
A simple but effective authentication system with user levels (regular user and admin). Uses SQLite for persistence with functions for adding/removing users, checking authentication levels, and updating admin privileges. Demonstrates proper parameterized queries to prevent SQL injection. Could be reused in any application needing lightweight authentication.
A flexible internationalization system that loads language-specific YAML files with fallback to English. Handles missing translations gracefully and supports string formatting. Demonstrates good separation of UI text from code logic. Could be extracted for any application needing multi-language support.