Skip to content

fix(queue): correct queue-size documentation guidance#161

Open
anoldguy wants to merge 2 commits intodanyspin97:mainfrom
anoldguy:fix-queue-documentation
Open

fix(queue): correct queue-size documentation guidance#161
anoldguy wants to merge 2 commits intodanyspin97:mainfrom
anoldguy:fix-queue-documentation

Conversation

@anoldguy
Copy link
Contributor

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.

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.
@danyspin97
Copy link
Owner

Hi @anoldguy and thank you for this PR as well :)

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.

You are right, it's backwards 😅

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.

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants