Open hakaserver opened 7 months ago
Made a pull request #31.
In the first commit:
In a separate second commit:
With these changes, it should all work correctly even with few results, as long as there is 1 search result. I made the changes in 2 separate commits since the loop once implementation was the best I could come up with, in case you have a better or cleaner way of doing it.
When setting 'Max Pages' has a minimum accepted value of 1, and when setting to 1 page the final url it generates to search has the parameter pid=1. However the first page should be pid=0. This causes the extension to never be able to find the first 100 images for any tag searched. This is a problem when the tags searched returns less than 100 images (such as some artist tags, character tags and more obscure general tags).
Also, when using the ComfyUI node version of the extension I didn't find any way to set 'Max Pages', which causes the search to frequently fail.
In addition to that, I'd like to suggest an alternative: Instead of manually inputting 'Max Pages', make an initial search with pid=100 and lookup the number of search results ('count' as seen below).
Using the count number you can calculate 'Max Pages' based on how many results per page there is.