removing some books info removes whole sdr folder
richo67 opened this issue · 8 comments
Hi,
today I discover when I select few lua files belonging to the same book (but not all) and press DEL, KoHighlight will remove whole sdr folder with all lua files. Quite shocking. Please take a look at he screen recording (no audio).
screen-record.mp4
Well, this is a side effect of the bonus feature that was added after your suggestion.. 😉
But anyway, what happens is not that shocking. After all, the program is warning you that the "selected books' information" will be deleted. The "selected books' information" is the .sdr
folder.
I have to remove the folder, otherwise we end up with .sdr
folders that are either empty, containing .old
files or whatever else the devs are going to put there.
What looks confusing, is that I don't clear the other rows (of the same book) too.
I'll put it in the todo
list for the next release..
Maybe you didn't noticed but I have not removed all .lua but only those additional. So the original one should have stay there together with the .old. And therefore the sdr folder should not be removed.
Also if I have more (5 for example) extra lua file and remove more than one in one DEL press ( 2 for example) whole folder is removed.
And yes the rows of the removed extra .lua files are not removed from UI.
Maybe you didn't noticed but I have not removed all .lua but only those additional. So the original one should have stay there together with the .old. And therefore the sdr folder should not be removed.
The action that you perform when pressing the del
button is the first of three Delete
actions (you can see them if you right click and select Delete).
That one is "Delete">"Selected books' info".
It is not delete selected .lua
files.
So it doesn't matter how many .lua
files you have selected.
The book's info gets deleted.
And the book's info is the .sdr
folder.
I see, but wouldn't have it much more sense that you would consider book info only the selected .lua file and delete only that file?
If you select the one which is correctly related to a book than you can remove whole folder, because as you correctly wrote, it has no sense to keep the folder if the metadata.*.lua file is not there. I think however if you select to delete not the primary lua file (all those strange file I have there ;-) ), then you should delete only that file.
What do you think?
My problem with this is that it makes the code more complicated for an edge case scenario.
Its much easier to right click > Open location
and manually delete the files.
OK, I do not see in your code so I can understand, but you already have pointer to that particular file once I select merge, isn't it not much more difficult then open and merge a file than only delte it?
I can always access the file. The problem is that I have to add more checks in the "delete actions" that will complicate and slow down the code (you can delete a lot of files at once).
My main objection is that this is an edge case and there is a comfortable workaround already..
Yes I understand. I hate workarounds though, especially as user ;-)