Fixed
- Active download count going negative – Fixed a bug in
downloadQueue.tswhere the active download counter could decrement below zero. When a download was paused mid-flight (afterincrementActiveCounthad been called), early-return paths inside thetry/catchblocks did not account for thefinallyblock also callingdecrementActiveCount, resulting in a double-decrement. Added adidIncrementflag sofinallyonly decrements when the increment actually ran. - Rate limiter race condition with concurrent downloads – Fixed
RateLimiter.throttle()inrateLimiter.tswhere multiple concurrent callers could all read the samelastCallTimesimultaneously, all conclude no wait was needed, and bypass the rate limit entirely. Calls are now serialized through an internal promise chain so each caller waits its own minimum interval in sequence. - Multiple queue-processing loops racing – Fixed
downloadQueue.tswhere thefinallyblock calledprocessQueue()unconditionally, allowing multiple concurrentdownloadTrackcompletions to each start a new processing loop. The call is now guarded with!this.processingso only one loop runs at a time. blocking_lock()in async context – Fixedlib.rswindow close handler usingstate.settings.blocking_lock()inside a Tokio async runtime, which can deadlock if the lock is held by an async task on the same thread. Replaced withtry_lock(), falling back to allowing the close if the lock is contended.- Duplicate tag-writing error paths – Consolidated the MP3/FLAC tag-writing error handling in
download.rsfrom two identical copy-pastedif let Errblocks into a single unified handler, eliminating the duplication. - Album track fetch performance –
get_album_tracksinmod.rspreviously fetched tracks then waited for that to complete before fetching album metadata (cover art, title) in a second sequential HTTP round-trip. Both requests are now issued concurrently withtokio::try_join!.