Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 11-23-2023, 01:58 PM   #1
stasiana
Junior Member
stasiana began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Nov 2023
Device: Kobo Sage
Filename template bug?

Calibre allows you to specify a template for how files are saved to an ereader. I use Kobo ereaders and I also have a column configured to as the collection of a book, so I modified the template as follows:

Code:
{#collection}/{author_sort}/{title} - {authors}
When I sent books to the device, it ended up creating garbled naming for the #collection directory names. For example:

Code:
chess
chss
coming
ecoics
econmics
economics
meir
memoir
military
self-imovement
I definitely don't have mangled collect names in the Calibre library. What's going on?

Click image for larger version

Name:	Screenshot from 2023-11-23 10-51-11.png
Views:	95
Size:	130.6 KB
ID:	204866

Click image for larger version

Name:	Screenshot from 2023-11-23 10-54-31.png
Views:	93
Size:	31.7 KB
ID:	204867

Last edited by stasiana; 11-23-2023 at 02:02 PM.
stasiana is offline   Reply With Quote
Old 11-23-2023, 02:06 PM   #2
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,771
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Maybe you have a typo in some of the collection names.
JSWolf is offline   Reply With Quote
Old 11-23-2023, 02:07 PM   #3
stasiana
Junior Member
stasiana began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Nov 2023
Device: Kobo Sage
No, I don't. I can see in the Calibre collection pulldown that everything is correct.
stasiana is offline   Reply With Quote
Old 11-23-2023, 02:13 PM   #4
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,771
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by stasiana View Post
No, I don't. I can see in the Calibre collection pulldown that everything is correct.
Have you ever had a typo and since fixed it?

Have a look at the books in the misspelled collections and see what books they are and then look at the same books in the library.
JSWolf is offline   Reply With Quote
Old 11-23-2023, 02:23 PM   #5
stasiana
Junior Member
stasiana began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Nov 2023
Device: Kobo Sage
I have already double checked, triple checked, that it is not due to content. I've used the collection names for years, loaded into the Kobo as actual names of the collections.

These are not typos and these are not left-over files on the device. I wouldn't call them typos because I definitely did not type these ever.

The device was factory reset just prior to my posting. I changed the template and synced. I watched these folders get created by Calibre on the device mangled. I went back and looked at the individual books and in the Calibre library they are correctly named.

Unless Calibre has these mangled strings in its database that is not shown in the UI, it is mangling them upon sending the books to the device.
stasiana is offline   Reply With Quote
Old 11-23-2023, 02:37 PM   #6
stasiana
Junior Member
stasiana began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Nov 2023
Device: Kobo Sage
Interesting, upon further investigation, when it mangles the collection directory name, it also mangles the author directory name. But it does not mangle the epub filename itself. Definitely a bug in the app.
stasiana is offline   Reply With Quote
Old 11-23-2023, 02:59 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: 31,067
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Your pathnames are being shortened to comply with all OS limits (AKA Windows)
theducks is online now   Reply With Quote
Old 11-23-2023, 03:14 PM   #8
stasiana
Junior Member
stasiana began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Nov 2023
Device: Kobo Sage
Quote:
Originally Posted by theducks View Post
Your pathnames are being shortened to comply with all OS limits (AKA Windows)
Thanks, I just figured this out too when realizing all the mangled directories have filenames that are really long. That's it.

The shortening behavior is very counterintuitive. Directories are meant to organize and shouldn't be mangled. It doesn't help to have "chess", "chss", and "cs".

The filenames, on the other hand, can be since usually the title/author metadata is displayed on the ereader instead of the filename anyway.

Can this behavior be changed?
stasiana is offline   Reply With Quote
Old 11-23-2023, 03:26 PM   #9
Sirtel
Grand Sorcerer
Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.
 
Sirtel's Avatar
 
Posts: 13,485
Karma: 239219543
Join Date: Jan 2014
Location: Estonia
Device: Kobo Sage & Libra 2
Why do you need collections as directories on your Kobo? For KOReader?
Sirtel is offline   Reply With Quote
Old 11-23-2023, 03:44 PM   #10
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,288
Karma: 169098402
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
You might also want to change your template to shorten the author-sort and author fields. What I use is Elib/{author_sort:sublist(0,1,&)}/{title} - {authors:sublist(0,1,&)} where the sublistsublist(0,1,&) shortens the field to the first author name.

As for adding the collection name to the file path, since you mention the title/author metadata being displayed, why not simply add the books to a collection set in metadata on your Kobo ereader. See the second tab of the KoboTouch/KoboTouchExtended driver for the collections configuration.
DNSB is offline   Reply With Quote
Old 11-23-2023, 04:37 PM   #11
stasiana
Junior Member
stasiana began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Nov 2023
Device: Kobo Sage
Quote:
Originally Posted by DNSB View Post
You might also want to change your template to shorten the author-sort and author fields. What I use is Elib/{author_sort:sublist(0,1,&)}/{title} - {authors:sublist(0,1,&)} where the sublistsublist(0,1,&) shortens the field to the first author name.
That's an awesome tip, thank you.

I want to do this so that I can make sense of the books when viewing the directories. KOReader also.
stasiana is offline   Reply With Quote
Old 11-23-2023, 04:43 PM   #12
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,288
Karma: 169098402
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by stasiana View Post
That's an awesome tip, thank you.
I started using this since some of my spouse's books are anthologies that have 20-30 authors listed and they would exceed the path length limit just for the authors.
DNSB is offline   Reply With Quote
Old 11-23-2023, 11:41 PM   #13
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,988
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
This happened to me a few years ago:

Quote:
Originally Posted by ownedbycats View Post
I'm not sure if this would also be present with the regular Kobo driver.

I ran into a glitch where between the length of multiple (long) author names and the .kepub extension, the filepath seemed to hit some sort of limit and truncated part of my custom save path ({#kobopath}/{author_sort}/{title} - {authors}) , resulting it ending up in K:\Fanion\ instead of \Fanfiction\.

Thankfully I was able to fix it with a {author_sort:sublist(0,1,&)} to show only the main author, but I found it strange that it truncated the path instead of the filename. Did I make a user error?
Quote:
Originally Posted by davidfor View Post
The path creation is done by calibre. The drivers supply a maximum path length and calibre works something out in that. It does tend to shorten the actual file name more than the rest of the path, but, I have seen this myself. I use a couple of different libraries, and put the library name first. Occasionally the library name gets shortened. From a quick look at the code, all parts of the path can be shortened, but the longer the part, the more will be taken from it. Hence the file name part will usually be changed the most.
Quote:
Originally Posted by ownedbycats View Post
The original truncated path was exactly 180 characters (setting author_sort to a sublist shortened it to 156) and the filename did change quite a bit. If it had been able to display in full, it would've been 205 characters.
Quote:
Originally Posted by davidfor View Post
The driver sets the maximum path length to 185 characters. With it needing to remove 20 characters, I am not surprised the first directory was touched.
ownedbycats is online now   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Save Template, is appending one tag to a filename possible? chrisric Library Management 5 04-29-2023 12:52 PM
Request: Match Calibre Filename template recipe cbook7 Library Management 10 06-05-2020 05:11 AM
Download Filename Template? nqk Server 2 06-02-2020 04:19 AM
Change filename template in Calibre's library 8140david Library Management 3 09-25-2016 11:39 AM
filename template feature artbatista Calibre 0 08-23-2009 01:05 PM


All times are GMT -4. The time now is 01:18 AM.


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