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: