jacquesh / foo_openlyrics

An open-source lyric display panel for foobar2000
MIT License
407 stars 24 forks source link

Add tracks to a single search queue when requesting a bulk search while one is already in progress #223

Closed jacquesh closed 1 year ago

jacquesh commented 1 year ago

Bulk search exists to allow users to easily collect lyrics for many tracks without having to manually search for each one. Since this presents an easy opportunity to heavily spam web sources, an artificial delay is intentionally introduced between searches for individual tracks. This is acceptable because bulk search is intended to be a mostly-background process.

However it is currently trivially possible to spawn many small bulk searches in parallel, thereby defeating the point of the artificial delay.

We should prevent users from trivially spawning many parallel bulk searches, but the naive way of doing that (simply disallowing new searches while one is in progress) gives very bad UX. Instead we should do what the Windows file copy utility does and simply tack the newly-requested tracks onto the end of the existing bulk-search queue. That way the user always has at most one bulk search in-flight at any given time, making it easy to manage without preventing them from adding new tracks to be searched while an existing search is in progress, but without spamming web sources.