$ show RudeySH/lastfm-bulk-edit
Last.fm Bulk Edit is a browser userscript that enhances Last.fm's website functionality to enable bulk editing of scrobbles. It operates as a userscript that runs on Last.fm pages, adding a 'Bulk edit scrobbles' menu item to artist, album, and track pages. When activated, it fetches all scrobbles for the selected entity (handling pagination), groups them by album/album artist combinations, and presents an enhanced edit form that allows modifying multiple scrobbles simultaneously. The application also enhances Last.fm's automatic edits page with sorting and filtering capabilities, adds album names to scrobble overview pages, and creates timestamp links in scrobble listings. Built with TypeScript and webpack, it uses a modular architecture with separate features for different enhancements, a custom modal system for dialogs, and sophisticated retry logic for network requests.
The LLM identified 3 files worth highlighting for reuse:
A self-contained modal implementation that provides reusable popup functionality with proper lifecycle management. Features include dismissible backgrounds, outside-click detection, extensible options pattern, and inheritance support (as demonstrated by LoadingModal). The component is isolated from application logic, depends only on constants for CSS namespacing, and could be extracted to any web project with minimal adaptation (primarily updating CSS class references). Demonstrates non-obvious skill in managing DOM lifecycle, event delegation, and extension patterns.
A sophisticated HTTP request utility that implements exponential backoff retry logic with rate limit handling. Features include semaphore-based concurrency control (limiting to 6 concurrent requests), intelligent delay progression (1s → 2s → 4s → 8s → 16s), and special handling for 429 responses with increasing delays up to 60s. The function is generic, isolated from DOM specifics, and could be extracted as a standalone utility for any project requiring reliable HTTP requests. Shows expertise in network resilience patterns and adaptive retry strategies.
Contains reusable batch processing utilities (forEach and forEachParallel) that implement both sequential and parallel execution with accurate progress tracking. Key innovation is the weighted processing system where items can have different weights (based on scrobble count) to provide meaningful progress percentages during operations with variable-length tasks. The utilities work with a Step interface to track completion states of nested operations. While part of the main file, these functions are self-contained, have minimal dependencies (only the Step interface), and represent a non-obvious solution to the common problem of providing accurate UI feedback during heterogeneous batch operations.