Open evandrocoan opened 3 years ago
thanks for reporting this, I'm going to look into it. just curious, we've had many users reporting that addon upgrades result in wiping out the cache directory, how are you not impacted by this, you have your own git checkout of awesometts ?
Yes, I do. All my Anki add-ons are just a git repository (with submodules for the addons I can fork on GitHub): https://github.com/evandrocoan/AnkiAddons
I just cleaned out my cache dir and the slowness at the close was fixed. Perhaps cleaning the directory after 1000 entries would be the solution?
Well it turns out some people highly treasure their cache directory and get very upset when it gets cleaned out. I guess they sign up for an API key on azure or google as a one time thing and then pre-cache all their audio. So I need to give this some thought.
2.1.3x comes with a background task manager (although untested in practice). You could move some of those code to background tasks on a separate thread, limiting this to one scan every 24hrs on startup should be enough.
I actually undeleted my cache directory because it was causing AwesomeTTS to create duplicate audio files as ATTS ボク モク(google ja).mp3
and ATTS ボク モク(google ja)-5568d833959b394ab4c2a45068048505300ffbd1.mp3
.
Originally posted: https://github.com/ankitects/anki/pull/1363#issuecomment-919592713
This addon has registered the hook
Hook(name="profile_will_close", legacy_hook="unloadProfile"),
:It is doing some search on the file system and depending on how many audios I have cached or saved, it can take a long time to complete.
I got 14.000 files in my cache directory (over an old HD) and this makes Anki too about 2 minutes to close: