$ show mariusor/mpris-scrobbler
mpris-scrobbler is a minimalistic user daemon written in C that listens to MPRIS D-Bus signals from media players (e.g., Spotify, Rhythmbox) and submits currently playing tracks to Last.fm, Libre.fm, and ListenBrainz scrobbling services. It consists of a daemon binary and a signon helper for authentication. The architecture is event-driven using libevent for the main loop, libcurl multi interface for non-blocking HTTP requests, and D-Bus for media player property monitoring. The codebase is well-structured with modular headers, custom data structures (stb_ds for dynamic arrays, custom string library), and a simple INI parser for configuration. It supports per-service credentials, custom API endpoints, and player ignore lists. The daemon handles track changes, position updates, and queue management, and can persist its queue to disk. Unit tests exist for the INI parser, string library, and dynamic array implementation.
The LLM identified 2 files worth highlighting for reuse:
Implements the integration between libcurl multi interface and libevent's event loop for non-blocking HTTP requests. It provides socket and timer callbacks (CURLMOPT_SOCKETFUNCTION, CURLMOPT_TIMERFUNCTION) that manage socket events via libevent, and handles transfer completion, retry logic, and connection cleanup. This pattern is non-trivial and reusable for any project needing async HTTP with libevent, demonstrating solid understanding of both libraries.
A self-contained INI file parser written in C that supports sections, key-value pairs, comments, and trimming. It uses the stb_ds dynamic array library internally but could be extracted with minimal changes. The parser is tested (ini_reader_test.c) and handles edge cases like comments, multiline? Actually it reads line by line. It's a clean, embeddable configuration parser suitable for any C project needing simple INI-style configuration.