$ show Predidit/Kazumi
Kazumi is a cross-platform Flutter application for browsing, collecting, and streaming anime (番剧). At its core, it provides a curated media experience: users can discover anime via popularity rankings, weekly schedules, text and image (trace.moe) search; manage a local watchlist synced with Bangumi (bgm.tv) and WebDAV; and play videos using a hardware-accelerated media_kit (libmpv) player with danmaku overlay, Anime4K super-resolution shaders, Picture-in-Picture, and external player support. It also downloads episodes (HLS segments) for offline playback and supports synchronized group viewing via the Syncplay protocol. The application is built as a Flutter monolith with modular routing (flutter_modular), reactive state management (MobX), local storage (Hive), and a custom plugin system that defines scraping rules (XPath/API) to extract video sources from third-party websites. External dependencies include Bangumi, DanDanPlay, trace.moe, WebDAV servers, and a GitHub-hosted plugin catalog. The codebase demonstrates mature engineering practices including well-isolated async utilities, event-sourced history sync with conflict resolution, and platform-specific WebView integrations for video source extraction and captcha handling.
The LLM identified 4 files worth highlighting for reuse:
Provides a generic AsyncRateLimiter class that limits the rate of asynchronous function invocations. It accepts a duration and an optional backlog limit, ensuring that calls are spaced out or dropped if the queue is full. This utility is self-contained (no internal imports beyond dart:async) and can be extracted into any Dart project needing rate-limited async operations.
Implements the Single Flight pattern for Dart async operations: given a key and an async function, it ensures only one outstanding call per key at a time, sharing the result with concurrent callers. The implementation is test-covered, thread-safe, and has no internal dependencies beyond dart:async. It can be reused in any Dart project to deduplicate expensive async operations.
Provides an AsyncSerialQueue class that serializes asynchronous operations, ensuring they execute in FIFO order sequentially. It uses a simple queue and future chaining, with no external dependencies. This is a standalone utility suitable for any Dart project that needs to avoid concurrent execution of state-mutating operations.
Implements a custom M3U8 playlist parser that handles both master and media playlists, including hierarchical segment resolution, EXT-X-KEY extraction, and DISCONTINUITY handling. The parser is test-covered, has no external HTTP dependencies (it works on string input), and can be extracted into any Dart project needing client-side HLS playlist analysis or ad filtering.