-
-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drop DB before importing #1389
drop DB before importing #1389
Conversation
This drops the DB. But I forgot about the card images. We should probably also delete those. |
Looks like the unit test is stuck again :/ |
So as a result imported cards will sometimes show old images. Seems to work well otherwise in my tests. |
So we'd probably have to make a list of existing files before the import. Then subtract the files after the import and delete the rest. |
Will look into that. But not today. |
I don't think the images are ever deleted currently, even when the card is deleted. |
They are. I just looked in the wrong place. |
I added code to remove the old images. |
This won't delete any existing image files unless the import succeeds. But existing image files may be overwritten by a failed import. To avoid that we'd have to e.g. save them to a temporary directory instead and move them after the import succeeds. I can make a follow-up PR for that if you'd like, but this seems like a worthwhile improvement already and I don't want to make it unnecessarily complex. |
Split off from #1343: