AwesomeTTS / awesometts-anki-addon

AwesomeTTS text-to-speech add-on for Anki
GNU General Public License v3.0
484 stars 100 forks source link

ensure mp3 cache doesn't get emptied on addon upgrade #198

Open luc-vocab opened 3 years ago

shubniguroth commented 3 years ago

This 5,000%. I stopped upgrading because it was costing me so much money every month to rebuild the cache.

Can I simply copy out and replace the cache after upgrade? Would that work?

Or would the addon not use those old sounds anymore, since there would be no internal references to those cached sounds?

Either way, I'm not upgrading until I'm ready to spend another $30 on google cloud services to completely rebuild the Wavenet cache I have.

luc-vocab commented 3 years ago

is batch generation an option for you ?

shubniguroth commented 3 years ago

is batch generation an option for you ?

Unfortunately, it is not. Not for me anyway. I have multiple clozes per card and the clozes are the most important part. Could I do it? Yes probably, using multiple fields per cloze etc. But it would take forever and be extremely labor intensive for 20k+ cards

luc-vocab commented 3 years ago

I think I should be able to find a solution, give me a bit of time.

shubniguroth commented 3 years ago

Thank you!! Of course I appreciate it, your addon is such an incredible help to me already, this just makes it even better. Has made learning medicine a much more straight-forward and enjoyable process.

NSBum commented 3 years ago

+1

In the meanwhile, I just set up a pronunciation archive folder with a folder watcher to keep .cache and the archive directory in sync.

luc-vocab commented 3 years ago

Understood, this feature should be a priority. I'll try to get it in in the next release.

luc-vocab commented 3 years ago

all, the cache directory will move from the .cache directory in awesometts to user_files/cache/. I believe this should stay in place across upgrades. However people will need to manually copy the files to the new cache location. Is this acceptable ? In fact it might be a good idea to make a backup of your cached mp3 files right now before the upcoming upgrade.

NSBum commented 3 years ago

That's great. It's acceptable to me; though the average (non-techie) user is going to need some clear directions about how to move the cache files to the new location to avoid any surprises. I don't know that the add-on upgrade dialog that Anki presents on launch offers the opportunity to provide a warning to users before executing the upgrade; so possibly a heads-up on the Anki support forum and on r/Anki would be a good idea.

On macOS, it was just

#!/bin/bash

ADDON="$HOME/Library/Application Support/Anki2/addons21/1436550454"
cp -R "$ADDON/awesometts/.cache" "$ADDON/user_files/cache"
luc-vocab commented 3 years ago

@NSBum @shubniguroth WARNING! In AwesomeTTS 1.48, the mp3 cache directory has been moved from %APPDATA%\Anki2\addons21\1436550454\awesometts.cache to %APPDATA%\Anki2\addons21\1436550454\user_files\cache . If you want to preserve your cached files before upgrading, please back them up from the previous location, and after installing 1.48, you can copy the cached mp3 files to the new location.

yanngdsl commented 2 years ago

Hello, The last 1.69 version breaks the cache again.

luc-vocab commented 2 years ago

@yanngdsl can you tell me the exact issue you're having ?

yanngdsl commented 2 years ago

Since the last update if I select all my cards the plug-in download mp3 for all cards and not just for the new / updated cards.