fix(queue): correct queue-size documentation guidance#161
fix(queue): correct queue-size documentation guidance#161anoldguy wants to merge 2 commits intodanyspin97:mainfrom
Conversation
The documentation states the queue "only works when queue-size is bigger than available images." From my reading of the code, this appears backwards and may cause the issues reported in discussion danyspin97#136. When queue-size approaches or exceeds available images, the random selection loop struggles to find unseen images after several attempts, falling back to recent duplicates. Navigation also appears to hit buffer boundaries, blocking next and previous commands. Updated guidance to recommend queue-size smaller than total images, ideally half or less. Added runtime warning when queue-size >= image count, matching the pattern used elsewhere for configuration validation. Extracted helpers (`get_queue_and_file_count`, `warn_if_queue_too_large`) to avoid repeating logic across initialization and update paths. Still learning Rust idioms, so feedback welcome on both the analysis and approach. Addresses GitHub discussion danyspin97#136.
Apologies for missing this in the initial commit. I should have run `cargo fmt` before submitting the PR, I'm still getting used to the Rust workflow.
|
Hi @anoldguy and thank you for this PR as well :)
You are right, it's backwards 😅
Taking into account the current status of the queue implementation, it makes sense. However, I know that many people wants to avoid duplicates before having seen all wallpapers available, and this works against their use case. Instead of suggesting the queue to be half of the size of the available wallpapers, I would rather fix the code that is making the queue buggy. I am thinking that there should be option to avoid duplicated wallpapers without setting a number. What do you think? |
The documentation states the queue "only works when queue-size is bigger than available images." From my reading of the code, this appears backwards and may cause the issues reported in discussion #136.
When queue-size approaches or exceeds available images, the random selection loop struggles to find unseen images after several attempts, falling back to recent duplicates. Navigation also appears to hit buffer boundaries, blocking next and previous commands.
Updated guidance to recommend queue-size smaller than total images, ideally half or less. Added runtime warning when queue-size >= image count, matching the pattern used elsewhere for configuration validation.
Extracted helpers (
get_queue_and_file_count,warn_if_queue_too_large) to avoid repeating logic across initialization and update paths.Still learning Rust idioms, so feedback welcome on both the analysis and approach.