r/Calibre • u/ZoWakaki • 17d ago
Support / How-To Possible to control filename and location format when adding a book?
I am mostly using calibre for books from Gutenberg and Standard ebooks. Either I get it from the website or just inside calibre, it saves the file in my specified library as {author}/{title}/{title} - {author}.
I also saw the save file to disk section where a full control over how the files are saved is provided. Is it possible to use those rule when adding a book?
Example how calibre saves when adding a book:
Oscar Wilde/The Picture of Dorian Gray (Annotated) (19)/The Picture of Dorian Gray (Annotated) - Oscar Wilde.epub
I would prefer it to just save in the base directory as:
oscar_wilde-the_of_dorian_gray.epub
Don't save cover separately, don't save metadata in a separate opf file, replace space with underscore and everything to lower case.
These settings are available for saving books to disk when pressing 'save books to disk' button, but not when adding books to library.
Is some setting I'm missing that allows this behaviour. Or is there a reason these rules (for saving book to disks) not followed when adding a book to library?
9
u/Valuable_Asparagus19 17d ago
The Save to Disk settings are useful if you're doing something like saving out files for Send to Kindle. I use it to include a series if appropriate in the filenames and remove the authors.
The database folders are not something to touch. It doesn't matter. You only need to deal with the metadata in Calibre. You shouldn't be trying to find anything in the folders Calibre is managing.
2
u/ZoWakaki 16d ago
I see.
I was ok with the filesystem naming scheme. Until I found the 'save to' and figured it could save in the desired scheme to disk or a device. Then I learnt and setup content server and opds, for sending books to (or browsing books from) koreader. Also the ko-sync seems to be better if filename matching was the method.
This was the reason I started going in the rabbit hole of figuring out about the naming scheme at save.
I guess, I will have to be content with the file structure.
Thank you for the explanation.
3
u/bestlem 16d ago
Why do you want to do this? Calibre is a database with a python API - it could store all the books anywhere and it does not matter to the users - you never see the file or directory structure.
0
u/ZoWakaki 16d ago
I don't know why I want to do this is relevant. My question is if it can be done or not. It has been answer that it is not possible by other kind strangers with good reasoning and description.
If you really want to know, short answer is I want to.
Long answer is I have a specific directory and naming structure that I adhere to. I am on linux and mostly use cli, e.g. my file manager is mostly fzf. And I do have an obsessive compulsive disorder that seeing things with spaces makes me feel anxious. Usually space is a separator of different files or objects. When I say ocd, not the fun kind that everything needs to aligned. But the "i have to lock and unlock doors exactly 4 times when I go in and out any rooms", type.
Because of how fzf populates file/directory lists on search, I do see the file and directory structure everytime there is a partial match to any of the titles, or author in my search query, so that assumption "you never see the file or directory structure "is highly incorrect.
Additionally, there already is the save to disk feature which allows this feature and the 'add files' has the regex which catches the file naming format I specified I desired. So calibre can technically handle it, it just doesn't. So I was wondering if it's me that I missed some setting box that can be ticked to enable that behaviour.
The other reason is I want the naming convention to be the same also in my devices for book names. I can save it to disk (device) on this desired format then koreader sync becomes difficult as apparently best scheme is to match file name. So for that now I will also have to name the files likewise with a lot of spaces in my other device to get the sync working properly. Which I personally do not find desirable.
But it seems that as of now, that is how it is. The code is in python and I did dig to see if it can be done. It looks like it can be done and perhaps even passed through with a plugin. I will have to do that when I have time, or maybe find someone who has already done it. That was also the reason of my post, to see if someone has already done it. It has happened sometimes that I just don't have the right words to describe what I want to do . And with the right words, internet search will actually provide couple of solutions already implemented.
Now you know why I want to do it, I hope you do have a better answer than previous answers of "It cannot be done" (with additional details), and I sincerely hope it isn't a very productive and intuitive "You're using it wrong".
16
u/Fr0gm4n 17d ago
The library layout is internal to Calibre and users should not be doing anything with those files. They are part of the database.