02-16-2018, 01:20 PM | #1 |
Member
Posts: 18
Karma: 10
Join Date: Nov 2017
Device: iphone, ipad, android phone, android tablet, pc, kindle
|
Calibre Folder Output
I have a total 7244 subfolders under my calibre folder.
I host my library on a shared host and have reached the folder limit. Is there any way to group authors under alphabetic sequence? Example: all authors with names that start with A to be under subfolder A, and authors that begin with B to be under subfolder B, etc?? If I can have calibre split the authors via subfolder load it would resolve the problem. |
02-16-2018, 02:31 PM | #2 |
hopeless n00b
Posts: 5,111
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
|
Do you need the calibre file/folder structure itself on the shared host? Or would exporting via "Save to Disk" work as well? I expect it's not so much the author folders themselves that's the issue, rather it's the individual folders for each book.
For my save to disk, I use: {tags}/{authors}/{series} {series_index} {title} I use tags for genre (one per book). With a library of ~4,000 books, save to disk with the above template gives me ~900 folders versus ~5,000 folders in the native calibre structure. |
Advert | |
|
02-16-2018, 03:02 PM | #3 |
Member
Posts: 18
Karma: 10
Join Date: Nov 2017
Device: iphone, ipad, android phone, android tablet, pc, kindle
|
What I actually do is I sync the entire library with nextcloud, making a exact replica.
I use cops to run the library on my server. Currently I save author,title I have over 20,000 books and because I save by author the problem is that I have 7244 authors and that exeeds the folder list. If I could group authors by the letters of the alphabet in subfolders I could resolve the problem. |
02-16-2018, 03:41 PM | #4 |
Grand Sorcerer
Posts: 12,166
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
|
You can't change the structure of a calibre library. See Want to change folder structure or file names in the Calibre library?
|
02-16-2018, 03:41 PM | #5 | |
Wizard
Posts: 4,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
|
Quote:
What is suggested is that you use the Save to Folder option and provide to that a template that specifies the folder/filename structure that you want. |
|
Advert | |
|
02-16-2018, 03:50 PM | #6 |
Member
Posts: 18
Karma: 10
Join Date: Nov 2017
Device: iphone, ipad, android phone, android tablet, pc, kindle
|
Yes I have read the sticky, I am not trying to change the internal structure, but rather trying to find a solution inside the structure.
If I make a custom column, can I make it save with the column information, then author and then title? Example: Incan put a A next to all then authors that start with A, B next to all the authors that start with B. |
02-16-2018, 03:59 PM | #7 | |
Wizard
Posts: 4,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
|
Quote:
|
|
02-17-2018, 02:16 AM | #8 | |
hopeless n00b
Posts: 5,111
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
|
Quote:
For example: This is allowed (25,005,000 subfolders total): Code:
\parent |-- \child (x 5000) |-- \grandchild (x 5000 per child) Code:
\parent |-- \child (x 7500) |-- \grandchild (x1 each) Does COPS know (or can be configured) to use Author/Title as path/filename and not the normal Author/Title (id)/Title - Author that calibre uses? Because by my estimate, 20,000 titles with 7,244 authors would mean 27,244 folders with calibre's internal folder structure. One way to get around the per node restriction is to divide your main calibre library into multiple libraries. For example, by genre or by authors (A-E, F-J, K-O, P-T, U-Z). That said, if you're familiar with PHP scripting, I'm sure it's possible to modify the ebook url in COPS so you can use a custom folder structure. You then copy metadata.db and your save to disk folder to the host. For what you want, the save to disk template can be: Code:
{author_sort:'uppercase(shorten($,1,'',0))'||}/{title} - {authors} Code:
{authors:'uppercase(shorten($,1,'',0))'||}/{title} - {authors} |
|
02-17-2018, 02:28 AM | #9 |
Member
Posts: 18
Karma: 10
Join Date: Nov 2017
Device: iphone, ipad, android phone, android tablet, pc, kindle
|
There cannot be more than 7000 folders inside a folder. But there can be unlimited folders and subfolders as long as the first rule is not violated.
If save to disk was the solution I could have done the following: {author_sort:.1}/{author}/{title} - {authors} With the above statement 'Andrew Abernethy - The Beginning Of All Things' would have been saved as A/Andrew Abernethy - The Beginning Of All Things However, I cannot use save to disk because I need the metadata.db (as I use COPS OPDS). I DID manage to find a way to resolve the issue although it certainly is not pretty. I add an author for the letter of the Alphabet I wanted. Example: For all the authors with surname starting with A, I add first author 'A & '. Daryl Aaron becomes A & Daryl Aaron Andrew Abernethy becomes A & Andrew Abernethy Kathy Abranovich becomes A & Kathy Abranovich This way all these authors are stored under folder A, but their names remain in the database as well. Like I said, not pretty, but it does work.... Last edited by PetrusV; 02-17-2018 at 02:30 AM. |
02-17-2018, 03:09 AM | #10 |
null operator (he/him)
Posts: 20,568
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@PetrusV - maybe you should find a less restrictive host for the library, or pay the existing provider whatever it takes to increase the subfolder limit.
Partitioning your books over multiple physical libraries will impose irritating limitations on searching; you'll forever wonder why you didn't partition on something else - e.g. genre instead of author, or original publication date instead of publisher. IMO the only 'legitimate' reason to use multiple physical libraries is the nature of the 'books'. FX I have separate libraries for regular books, periodicals, and audio/video. They have very disparate custom columns, and my (mis)use of standard columns varies, e.g. my periodicals library has journal/magazine name in author and edition identifier (issue, month, folio etc) in title. BR |
02-17-2018, 04:06 AM | #11 | |
hopeless n00b
Posts: 5,111
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
|
Quote:
Had a quick look at COPS (latest master) and I think this might be what needs changing. Note, I don't have a PHP dev environment and it's been years since I last coded anything so no idea if this actually works. Code:
lib\Book.php line 116: $this->path = Base::getDbDirectory() . $line->path; line 117: $this->relativePath = $line->path; Assuming you have: Code:
A/Andrew Abernethy/The Beginning Of All Things (1)/The Beginning Of All Things - Andrew Abernethy K/Kathy Abranovich/Mupster Pupster (2)/Mupster Pupster - Kathy Abranovich Code:
lib\Book.php line 116: $this->path = Base::getDbDirectory() . strtoupper(substr($line->path,0)) . "/" . $line->path; line 117: $this->relativePath = strtoupper(substr($line->path,0)) . "/" . $line->path; |
|
02-17-2018, 04:59 AM | #12 |
Member
Posts: 18
Karma: 10
Join Date: Nov 2017
Device: iphone, ipad, android phone, android tablet, pc, kindle
|
@BetterRed
Yea the thing is I have a TON of stuff with this host. If I move I must move another 25 domains as well. Everything is cheap, works extremely well and I have unlimited space. The only snag is my calibre library because I have over 20,000 books. (I actually have 6 different libraries split to their relevance already) And yes, they are all related to the library they are in. So splitting this one is not an option @ilovejedd Unfortunately the problem is not COPS, but the CentOS server I am on, it limits folders to 7000 per folder. I cannot just use the 'copy to disk; option either, because COPS OPDS needs the metadata.db from calibre as well... |
02-17-2018, 10:51 AM | #13 | |
hopeless n00b
Posts: 5,111
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
|
Quote:
Granted, I don't recommend changing the path and filename significantly since the more it diverges from calibre's folder native structure, the more involved the changes needed in the COPS PHP scripts. With the changes to /lib/Book.php in post #11, I wouldn't even bother with save to disk. Just use a shell script to copy the author folders by first letter. So your calibre library folder on the CentOS server would look like this: Code:
/A /B ... /Z metadata.db |
|
02-17-2018, 12:14 PM | #14 |
hopeless n00b
Posts: 5,111
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
|
Whoops, looks like that code should have been:
Code:
lib\Book.php line 116: $this->path = Base::getDbDirectory() . strtoupper(substr($line->path,0,1)) . "/" . $line->path; line 117: $this->relativePath = strtoupper(substr($line->path,0,1)) . "/" . $line->path; |
02-17-2018, 01:01 PM | #15 |
Member
Posts: 18
Karma: 10
Join Date: Nov 2017
Device: iphone, ipad, android phone, android tablet, pc, kindle
|
@ilovejedd That sounds very interesting... I am definitely going to try that as soon as I get s chance!! Thanks for the great advice!!
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Plugin] FolderIn and FolderOut - Folder input and output plugins for Sigil | KevinH | Plugins | 18 | 11-11-2019 02:26 AM |
automatically open the output folder | CineMan | Conversion | 4 | 10-09-2017 06:19 PM |
Change Calibre output folder | pzbrawl | Calibre | 16 | 07-03-2015 01:08 AM |
Disable open output folder when saving to disk | steje | Library Management | 12 | 08-26-2011 04:09 PM |
HOW do you output conversions into ONE FOLDER? | darksaber35 | Calibre | 10 | 09-01-2010 10:50 PM |