Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 07-15-2023, 11:42 PM   #1
MsFlutter
Junior Member
MsFlutter began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Jul 2023
Device: Android 12 phone
Question calibre inconsistently removes center of saved ebook folders

When I save ebooks to disk, calibre will sometimes take a parent folder and remove the center. But it doesn't always do this - often times a folder will be both correctly saved and incorrectly saved, so instead of having

Quote:
The Hunger Games by Suzanne Collins/2 - Catching Fire by Suzanne Collins
The Hunger Games by Suzanne Collins/3 - Mockingjay by Suzanne Collins
or

Quote:
The Hungeanne Collins/2 - Catching Fire by Suzanne Collins
The Hungeanne Collins/3 - Mockingjay by Suzanne Collins
I'll have

Quote:
The Hunger Games by Suzanne Collins/2 - Catching Fire by Suzanne Collins
The Hungeanne Collins/3 - Mockingjay by Suzanne Collins
Does anyone know why this happens? Is there a way to fix it?
MsFlutter is offline   Reply With Quote
Old 07-16-2023, 12:49 AM   #2
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: 36,218
Karma: 145735388
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
I would suspect that you are running into filename/filepath length limits. Perhaps you could check the full path. Under Windows for example, start from the root of the drive that you are exporting to disk on. An example might be:

C:\Users\<your name>\Documents\2023\My Calibre Files\Calibre_Save_to Disk\The Hunger Games by Suzanne Collins\2 - Catching Fire by Suzanne Collins\Catching Fire - Suzanne Collins.azw3

You might also want to post the template you are using for Save to Disk. A sample template might look like:
Code:
{author_sort:sublist(0,1,&)}/{series:||} {series_index:|[|] - }{title} - {authors:sublist(0,1,&)}
Basically, this saves to disk in a directory based on the author sort for the first author in the list and then adds series [series index] - title - first author in the list. If the series has no values, you will get title - first author in the list.
Quote:
Collins, Suzanne/The Hunger Games [2] - Catching Fire - Suzanne Collins.azw3
Collins, Suzanne/The Hunger Games [3] - Mockingjay - Suzanne Collins.azw3
Andrews, Mary/The Last Centurion - Mary Andrews.azw3

Last edited by DNSB; 07-16-2023 at 12:46 PM. Reason: Changed quote to code for template
DNSB is offline   Reply With Quote
Advert
Old 07-16-2023, 06:17 AM   #3
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: 8,753
Karma: 62032371
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by DNSB View Post
I would suspect that you are running into filename/filepath length limits.
According to the late davidfor:

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.
The maximum path-length for KoboTouch is 185 characters. I don't know about save-to-disk.
ownedbycats is offline   Reply With Quote
Old 07-16-2023, 07:00 AM   #4
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,765
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
You can use the shorten() template function to construct file names where each segment has a maximum length and is shortened in a consistent way.

Using @DNSB's template as an example, the following ensures that the initial author_sort is never longer than 20 characters, the series is never longer than 15, the title is never longer than 25, and the first author is never longer than 20. The title and author split the value, placing an underscore between the parts. Thus the maximum length is 80 characters + the length of the series index + 8 (or so) for the fixed text in the template (brackets, slashes, hyphens, blanks).
Code:
{author_sort:'shorten(sublist($, 0, 1, '&'), 20, '', 0)'}/{series:'shorten($, 15, '', 0)'||} {series_index:|[|] - }{title:'shorten($, 15, '_', 9)'} - {authors:'shorten(sublist($, 0, 1, '&'), 10, '_', 9)'}
Example: for a test book with the following metadata:
  • title: Test Title aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbb bbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccc cccccccccccccccccccccccccccccddddddddddddddddddddd ddddddddddddddddddddddeeeeeeeeeeeeeeeeeeeeeeeeeeee eeee
  • author: Authorrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr, Test
  • author_sort: Authorrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr, Test
  • series: A Foobar Mumble Fratz
  • series_index: 16.00
@DNSB's template without the shorten()s produces:
Code:
Authorrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr, Test/A Foobar Mumble Fratz [16] - Test Title aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccdddddddddddddddddddddddddddddddddddddddddddeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee - Authorrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr, Test
The template with the shorten()s produces:
Code:
Authorrrrrrrrrrrrrrr/A Foobar Mumble [16] - Test Title aaaa_eeeeeeeee - Authorrrrr_rrr, Test

Last edited by chaley; 07-16-2023 at 07:13 AM. Reason: Left off the length of the fixed text
chaley is offline   Reply With Quote
Old 07-16-2023, 07:09 AM   #5
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: 8,753
Karma: 62032371
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
I'm pretty sure a cat walked across the keyboard while inputting that metadata.
ownedbycats is offline   Reply With Quote
Advert
Old 07-16-2023, 08:46 AM   #6
DrChiper
Bookish
DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.
 
DrChiper's Avatar
 
Posts: 918
Karma: 1803094
Join Date: Jun 2011
Device: PC, t1, t2, t3, aura 2 v1, clara HD, Libra 2, Nxtpaper 11
Quote:
Originally Posted by ownedbycats View Post
I'm pretty sure a cat walked across the keyboard while inputting that metadata.
Hmm, The Avengers, episode "The Hidden Tiger" (1967) with the cat society 'P.U.R.R.R' (Philanthropic Union for Rescue, Relief, and Recuperation) comes to mind ...
DrChiper is offline   Reply With Quote
Old 07-16-2023, 09:12 AM   #7
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,039
Karma: 6422750
Join Date: Sep 2020
Device: Calibre E-book viewer
Quote:
Originally Posted by ownedbycats View Post
I'm pretty sure a cat walked across the keyboard while inputting that metadata.
that's how it sounded. Angry cat, it seems
Comfy.n is online now   Reply With Quote
Old 07-16-2023, 10:00 AM   #8
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,407
Karma: 87454321
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Quote:
Originally Posted by DrChiper View Post
Hmm, The Avengers, episode "The Hidden Tiger" (1967) with the cat society 'P.U.R.R.R' (Philanthropic Union for Rescue, Relief, and Recuperation) comes to mind ...
I thought you made that up, but wasn't sure. I was fan of the original UK TV Avengers.
https://www.imdb.com/title/tt0516913/plotsummary/
Quoth is offline   Reply With Quote
Old 07-16-2023, 10:10 AM   #9
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: 74,424
Karma: 129358310
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
One question not asked yet is what does they metadata in Calibre look like for The Hunger Games books?
JSWolf is offline   Reply With Quote
Old 07-16-2023, 10:26 AM   #10
DrChiper
Bookish
DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.
 
DrChiper's Avatar
 
Posts: 918
Karma: 1803094
Join Date: Jun 2011
Device: PC, t1, t2, t3, aura 2 v1, clara HD, Libra 2, Nxtpaper 11
Quote:
Originally Posted by Quoth View Post
I thought you made that up, but wasn't sure. I was fan of the original UK TV Avengers.
https://www.imdb.com/title/tt0516913/plotsummary/
Those were the golden days of the UK TV series: memories, memories ...
DrChiper is offline   Reply With Quote
Old 07-17-2023, 06:14 AM   #11
MsFlutter
Junior Member
MsFlutter began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Jul 2023
Device: Android 12 phone
SOLVED: too long of file length

Quote:
Originally Posted by DNSB View Post
I would suspect that you are running into filename/filepath length limits. Perhaps you could check the full path. Under Windows for example, start from the root of the drive that you are exporting to disk on. An example might be:

C:\Users\<your name>\Documents\2023\My Calibre Files\Calibre_Save_to Disk\The Hunger Games by Suzanne Collins\2 - Catching Fire by Suzanne Collins\Catching Fire - Suzanne Collins.azw3

You might also want to post the template you are using for Save to Disk. A sample template might look like:
Code:
{author_sort:sublist(0,1,&)}/{series:||} {series_index:|[|] - }{title} - {authors:sublist(0,1,&)}
Basically, this saves to disk in a directory based on the author sort for the first author in the list and then adds series [series index] - title - first author in the list. If the series has no values, you will get title - first author in the list.
It was the file length limit
I put the export folder closer to the drive and cut some redundant data from the file path, which took it from

Quote:
{#genre}/{series} {authors:|by |}/{series_index:|Part |:} {title} {authors:|by |}/{series_index:|Part |:} {title} {authors:|by |}
C:\Users\aaaaa\aaaaaaaaa\aaaaaaaaa\aaaaaaa\aaa\dys topian\The Hunger Games by Suzanne Collins\Part 2_ Catching Fire by Suzanne Collins\Part 2_ Catching Fire by Suzanne Collins.epub
C:\Users\aaaaa\aaaaaaaaa\aaaaaaaaa\aaaaaaa\aaa\Rom ance\by John Green\The Fault In Our Stars by John Green\The Fault In Our Stars by John Green.epub
to
Quote:
{#genre}/{series:|| {authors:|by |}}/{series_index:|Part |:} {title} {authors:|by |}/{title}
C:\aaa\dystopian\The Hunger Games by Suzanne Collins\Part 2_ Catching Fire by Suzanne Collins\Catching Fire.epub
C:\aaa\Romance\The Fault In Our Stars by John Green\The Fault In Our Stars.epub
Why does calibre remove text from the centre of the folder/file names instead of the end? is there a way to make it remove more text from child folders, so the genres all stay together?
MsFlutter is offline   Reply With Quote
Old 07-17-2023, 07:42 AM   #12
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,765
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by MsFlutter View Post
is there a way to make it remove more text from child folders, so the genres all stay together?
I showed you how to do this in post #4.
chaley is offline   Reply With Quote
Old 07-17-2023, 07:43 AM   #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: 8,753
Karma: 62032371
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by MsFlutter View Post
Why does calibre remove text from the centre of the folder/file names instead of the end?
According to the late davidfor (emphasis mine):

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.
ownedbycats is offline   Reply With Quote
Old 07-17-2023, 03:13 PM   #14
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: 74,424
Karma: 129358310
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
[QUOTE=MsFlutter;4340605][quote]C:\aaa\Romance\The Fault In Our Stars by John Green\The Fault In Our Stars.epub [/qupte]

Should really be at best...

C:\aaa\Romance\John Green\The Fault In Our Stars.epub as some titles can be rather long.
JSWolf is offline   Reply With Quote
Reply

Tags
file names, saving books to disk, support, truncated, windows 10


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ebook creation and center element nindotza Calibre 9 04-02-2020 05:53 AM
Calibre inconsistently identifies device and sd card MarjaE Devices 2 10-18-2019 09:34 PM
Removing plugin in Calibre removes it from all instances of Calibre oblox Calibre 9 09-09-2016 05:39 AM
Calibre with "empty" folders (no ebook file) Orionpkmyz Calibre 1 11-13-2015 10:20 AM
NYT Removes ebook bestseller lists from print editions fjtorres News 12 06-05-2013 02:52 PM


All times are GMT -4. The time now is 03:19 AM.


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