-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
FR: don't delete the .sdr directory when deleting a book #8281
Comments
The .sdr is really annoying me, I remember talking about it lately here on github but can't remember where, each file (book) I open using koreader is creating .sdr file so my original folder (my library) now is a combination of pdf files and sdr folders, I hope you can just collect all the .sdr files into One folder and it'll be better if it's in the (koreader) folder with koreader files.. Or at least it could be hidden. |
I'm not against this, it looks quite sensible (except for the granularity: is there a reason to delete the book and keep the sdr? Does not make real sense to me.)
We could also just replace "Purge .sdr" with "Delete settings" (but "Delete settings" sounds even more dangerous than "Delete book"), or find an even better name. |
|
@poire-z reset instead of delete? |
Yes, sounds safer :) @Zeyadas also #4831. It's not super complicated to have it work - the problem is that there are MANY little places where we assumed things were in a .sdr folder alongside the book, places that will need to be 1) looked for and 2) adapted, so everything in KOreader works just as well (like, showing the dogear hint that a book is opened in file browser). |
Understood, thanks guys. |
Sorry, the issue's author here. Later I discovered that the metadata of But as far as I'm concerned, this is not the case when it comes to deleting a book (or its metadata). When deleting a book's settings, the whole Therefore, aside from any improvements in the UI, I hope that this problem can be fixed as well -- always check for extra files before deleting a directory. |
Hijacking this issue to add more links about off-topic #8281 (comment) discussed above: |
Btw, .sdr comes from Kindle, and KOReader was re-using it for storing its own stuff, kinda as a favor to Kindle users so they don't get multiple directories. I guess this issue requests we only remove the files this books' own.
So, when removing the epub book, we should remove Actually, the Purge .sdr button in File browser and History is a bit more careful than DocSettings:purge() (but it forgets to remove migration backups like old_dom20180528): koreader/frontend/apps/filemanager/filemanagerutil.lua Lines 32 to 44 in 1c2e5ee
I guess DocSettings:purge() should do it a bit like this, but checking for a bit more candidates than just .old. |
On Kindles all books must be put into the |
So, our current behaviour of deleting the whole .sdr folder when deleting its book is:
I'd rather fix koreader to delete only the things that he has written and are related to this book - but may be Kindle users will complain it does not really clean up anymore ? (Checking if a thing belongs to this EPUB book, but does belong to another MOBI book, but also wanting to delete KINDLE stuff as a favour to tidy Kindle users, might be complicated to do - we don't want to have to maintaint a list of suffix/files that Kindle software may create.) |
I do not think Kindle users expect (or use) KOReader to tidy their documents folder. |
Something like: delete two metadata files (current and old) attached to the book, then check if sdr folder is empty, and if yes, delete it. |
Yes, that's what I had in mind, how things should be done.
That's an option you allowed in your proposal above #8281 (comment). But it's something I have never seen requested. So, if there are any, users wanting to keep their highlights and deleting the book must already have some kind of workflow to save it before deleting it. |
As I wrote, Kindle does so. |
Went without the 3rd option with #8348, mostly because I don't want to think/discuss the 2 points (#8281 (comment)) it would trigger. |
Currently after opening pdf using this app, it creates folder in the same path as of pdf. When i navigate through file manager, its annoying to see folders. Can there be any way that the app keeps all these folders in fixed dedicated path directory rather than on the same folders as of pdf? |
Good ideas ! Some people got the same and did all that some months ago :) #10074, available since v2023.03. |
I have a book with 2 different formats, one named
KOReader.pdf
and the otherKOReader.mobi
. These 2 formats share the same.sdr
directory, so when I try to deleteKOReader.pdf
, the.sdr
directory forKOReader.mobi
just goes away as well, so I will lose all my bookmarks inKOReader.mobi
.There are 2 solutions I could think of:
.sdr
directory will be deleted, or even better, allow the user to keep the.sdr
directory..sdr
directory, e.g.KOReader.pdf.sdr/
. (However, this will become a breaking change.)The text was updated successfully, but these errors were encountered: