Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 07-24-2018, 06:55 AM   #1
elfnor
Junior Member
elfnor began at the beginning.
 
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}
in Preferences -> Saving books to disk

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
I have entries in my #folder column that go three deep such as "fiction.sff.shortstories" but none like "ficion". The tag browser works as expected and shows none of the odd tags.

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
elfnor is offline   Reply With Quote
Old 07-24-2018, 10:42 AM   #2
Adoby
Handy Elephant
Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.
 
Adoby's Avatar
 
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...
Adoby is offline   Reply With Quote
Advert
Old 07-25-2018, 12:40 AM   #3
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
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.
davidfor is offline   Reply With Quote
Old 07-25-2018, 05:01 AM   #4
elfnor
Junior Member
elfnor began at the beginning.
 
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,&)}
For my 3 deep hierarchy of tags in my custom column #folder this works:

Code:
{#folder:subitems(0,1)||/}{#folder:subitems(1,2)||/}{#folder:subitems(2,3)||/}{title} - {authors:sublist(0,1,&)}
Thanks
elfnor is offline   Reply With Quote
Old 07-25-2018, 01:55 PM   #5
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
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.
chaley is offline   Reply With Quote
Advert
Old 07-25-2018, 04:20 PM   #6
Adoby
Handy Elephant
Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.
 
Adoby's Avatar
 
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
Quote:
Originally Posted by elfnor View Post
Calibre 3.26.1 running Linux Mint 19
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.
Adoby is offline   Reply With Quote
Old 07-25-2018, 07:35 PM   #7
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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
Quote:
Originally Posted by Adoby View Post
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.
I believe there is only one enforcement rule so to allow moving a Library between OS (being aware of CaSe issues)
theducks is offline   Reply With Quote
Old 07-25-2018, 09:59 PM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is offline   Reply With Quote
Old 06-12-2020, 10:06 PM   #9
vorcisrdr
Junior Member
vorcisrdr began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jun 2020
Device: Boox Note 2
Quote:
Originally Posted by elfnor View Post
@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,&)}
For my 3 deep hierarchy of tags in my custom column #folder this works:

Code:
{#folder:subitems(0,1)||/}{#folder:subitems(1,2)||/}{#folder:subitems(2,3)||/}{title} - {authors:sublist(0,1,&)}
Thanks
Sorry for resurrecting the thread...

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.
vorcisrdr is offline   Reply With Quote
Old 07-30-2023, 08:45 PM   #10
sterned
Junior Member
sterned began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jul 2021
Device: Ipad. kindle for pc
Quote:
Originally Posted by kovidgoyal View Post
Path length restrictions are OS dependent. IIRC on non window OSes they are set to about twice what they are on windows.
not anymore with windows 10 I have very long path names more than 255 now.
sterned is offline   Reply With Quote
Old 07-30-2023, 10:09 PM   #11
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by sterned View Post
not anymore with windows 10 I have very long path names more than 255 now.
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.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 03:28 PM.


MobileRead.com is a privately owned, operated and funded community.