Skip to content
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

removing some books info removes whole sdr folder #17

Closed
richo67 opened this issue Oct 7, 2021 · 8 comments
Closed

removing some books info removes whole sdr folder #17

richo67 opened this issue Oct 7, 2021 · 8 comments
Labels

Comments

@richo67
Copy link

richo67 commented Oct 7, 2021

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
@noembryo
Copy link
Owner

noembryo commented Oct 7, 2021

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..

@richo67
Copy link
Author

richo67 commented Oct 7, 2021

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.

@noembryo
Copy link
Owner

noembryo commented Oct 7, 2021

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.

@richo67
Copy link
Author

richo67 commented Oct 8, 2021

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?

@noembryo
Copy link
Owner

noembryo commented Oct 8, 2021

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.

@richo67
Copy link
Author

richo67 commented Oct 8, 2021

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?

@noembryo
Copy link
Owner

noembryo commented Oct 8, 2021

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..

@richo67
Copy link
Author

richo67 commented Oct 8, 2021

Yes I understand. I hate workarounds though, especially as user ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants