07-24-2018, 06:55 AM | #1 |
Junior Member
Posts: 2
Karma: 10
Join Date: Jul 2018
Device: kobo glo
|
Problem with template and save to disk
I'm trying to follow this guide
https://manual.calibre-ebook.com/sub_groups.html and have successfully set up a hierarchical column #folder and entered the template Code:
{#folder:subitems(0,1)||/}{title} - {authors} When I save to disk I get folders that look like spelling errors that I swear are not in my custom column Code:
$ ls _catalog ficion fiction fion fn nonfiction All of the wrong folders have some books, but I can't yet see anything special or odd about these books or their metadata. I attempted to write a template to Save to Disk in a 3 deep folder structure, which has similar errors. Calibre 3.26.1 running Linux Mint 19 |
07-24-2018, 10:42 AM | #2 |
Handy Elephant
Posts: 1,736
Karma: 26785668
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Thinkpad E595, Ubuntu Mate, Huawei Mediapad 5, Bouye Likebook Plus
|
Take some of the books in the weird folders and add them to a new empty library (create it with the same structure as the old). Examine the books there and save to disk from there and see if you can reproduce it.
If you can't reproduce it then your library is corrupt. The library maintenance tools may fix it. Or make a copy of a book with the problem and post here. You can't post a copyrighted book so you have to use a public domain book and transfer the problem metadata to it: Work in the new test library (so you don't delete the real book!) I believe you can use a public domain epub book and simply drop it on the details pane. Then it should replace the existing epub or add a epub format book to the title. Save to disk again to write metadata to the epub and post here... |
Advert | |
|
07-25-2018, 12:40 AM | #3 |
Grand Sorcerer
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
@elfnor: You are probably hitting a path-length problem. When creating a file, calibre has to make sure that it has a legal file name. This includes making sure the full path is not to long. In Windows, the limit is 256 or 260 characters and I don't remember if similar limits are used on the other platforms.
When the path is to long, and this includes the directory you are saving to, calibre fiddles with the parts of the path to reduce the overall length. The examples you have are the type of changes I have seen. |
07-25-2018, 05:01 AM | #4 |
Junior Member
Posts: 2
Karma: 10
Join Date: Jul 2018
Device: kobo glo
|
@davidfor is right. All the books in the shortened folders are books of short stories with many multiple authors.
Only including the first author in the file name works: Code:
{#folder:subitems(0,1)||/}{title} - {authors:sublist(0,1,&)} Code:
{#folder:subitems(0,1)||/}{#folder:subitems(1,2)||/}{#folder:subitems(2,3)||/}{title} - {authors:sublist(0,1,&)} |
07-25-2018, 01:55 PM | #5 |
Grand Sorcerer
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
@elfnor: the "shorten" template function can help control path shortening. You would use the function to ensure that no name segment is longer than some N. Note that you would need to use Template Program Mode because you would need to use subfunctions.
|
Advert | |
|
07-25-2018, 04:20 PM | #6 |
Handy Elephant
Posts: 1,736
Karma: 26785668
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Thinkpad E595, Ubuntu Mate, Huawei Mediapad 5, Bouye Likebook Plus
|
Ubuntu (and Mint I assume) typically use the ext4 filesystem with around 4096 char max path length. What filesystem do you use?
Or does calibre enforce short paths in Linux as well? Filenames in ext4 must fit in 255 chars. Last edited by Adoby; 07-25-2018 at 04:24 PM. |
07-25-2018, 07:35 PM | #7 |
Well trained by Cats
Posts: 29,801
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
I believe there is only one enforcement rule so to allow moving a Library between OS (being aware of CaSe issues)
|
07-25-2018, 09:59 PM | #8 |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Path length restrictions are OS dependent. IIRC on non window OSes they are set to about twice what they are on windows.
|
06-12-2020, 10:06 PM | #9 | |
Junior Member
Posts: 2
Karma: 10
Join Date: Jun 2020
Device: Boox Note 2
|
Quote:
I'm about to test this because I was getting garbled second folder names... I use the same 'genre' style system as described in the doco. |
|
07-30-2023, 08:45 PM | #10 |
Junior Member
Posts: 4
Karma: 10
Join Date: Jul 2021
Device: Ipad. kindle for pc
|
|
07-30-2023, 10:09 PM | #11 |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
yes and try accessing those really long paths using windows explorer or 90% of windows software. Windows has supported long paths for over a decade, but in a half assed way because they want to keep backward compatibility, that can lead to those files easily becoming inaccessible for non computer savvy users. As such calibre is definitely not going to support creating them.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
"Save to disk" template problem | Phssthpok | Library Management | 2 | 05-30-2018 04:30 AM |
Need help - Save to Disk template | Gallips | Calibre | 8 | 06-28-2016 01:46 PM |
Save Books to Disk Template Problem | Buckskin | Library Management | 5 | 11-15-2015 11:37 AM |
Need help on a Save to Disk template | fidvo | Library Management | 2 | 08-12-2012 03:34 PM |
save to disk template | speakingtohe | Calibre | 9 | 05-29-2010 06:02 AM |