louisrli / anki-faws-image-search

FawsImageSearch - An image search addon for Anki that's free and working still
GNU Affero General Public License v3.0
1 stars 1 forks source link

fix freezing progress bar #1

Open louisrli opened 1 year ago

louisrli commented 1 year ago

UI freezes on op -- even using the background op on the main thread. using threadexecutor or anki's built in op doesn't really seem to help

we should look at awesometts's progress bar / job queueing system (presumably they're doing the same thing -- making a series of API calls) and might need to rewrite

https://github.com/AwesomeTTS/awesometts-anki-addon/blob/7abc4be585a23a308c1c667dfb9e6394741a7b6b/awesometts/gui/generator.py#L841

louisrli commented 1 year ago

_accept_update: https://github.com/AwesomeTTS/awesometts-anki-addon/blob/7abc4be585a23a308c1c667dfb9e6394741a7b6b/awesometts/gui/generator.py#L841

this is the parent function of updating the progress bar

we can consider rewriting something similar to the browsergenerator in general, but it seems like they use a queue (while the old implementation is simply running all the requests at once)

https://github.com/AwesomeTTS/awesometts-anki-addon/blob/7abc4be585a23a308c1c667dfb9e6394741a7b6b/awesometts/gui/generator.py#L314