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-18-2013, 09:26 AM   #1
Capricorn
Belgian Pommes Frites
Capricorn will become famous soon enoughCapricorn will become famous soon enoughCapricorn will become famous soon enoughCapricorn will become famous soon enoughCapricorn will become famous soon enoughCapricorn will become famous soon enough
 
Posts: 101
Karma: 532
Join Date: Jan 2012
Device: Pocketbook Touch HD
change the length of the pathname when sending to device

I use an Iriver HD Story ebook reader. The maximum length of the pathname and the epub name combined, on the ebook reader, may not exceed 200 characters, otherwise the epub will not open on the ebook reader.

However, I have some ebooks that have lots of authors (collections of stories by a number of authors), and hence makes for a pathname on the ebook reader that is really long - way beyond 200 characters.

Hence I have been experimenting in the preferences ->import/export->sending to devices
with the template to save the epub to the device.

I have tried:
{author_sort: sublist (0, 4, &)}/{title} - {series_index} {series}
and
{author_sort: shorten (80, -, 20)}/{title} - {series_index} {series}

but it does not change the length of the pathname at all.

I have searched the calibre forum for info, because it is the first time I try to change this template and my understanding is still very basic, but I did not find anything.

Is my syntax wrong? Or am I doing something else wrong? Or is there a far easier way to accomplish the same?

Any pointers or info would be much appreciated?
Many thanks,
Capricorn is offline   Reply With Quote
Old 07-18-2013, 09:57 AM   #2
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,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
There are two templates involved. The one in preferences is used the first time you connect to a device. After that, the one associated with the device wins.

Connect the device, right-click on the device button, choose configure, then change the template in that dialog.
chaley is offline   Reply With Quote
Advert
Old 07-19-2013, 07:48 AM   #3
Capricorn
Belgian Pommes Frites
Capricorn will become famous soon enoughCapricorn will become famous soon enoughCapricorn will become famous soon enoughCapricorn will become famous soon enoughCapricorn will become famous soon enoughCapricorn will become famous soon enough
 
Posts: 101
Karma: 532
Join Date: Jan 2012
Device: Pocketbook Touch HD
Hi Chaley,

Thanks for that tip. I did not know it worked in that sequence.

I changed the config of the device to:
{author_sort: shorten (80, -, 20)}/{title} - {series_index} {series}

and then I tried. What I found on the device, was a folder named "shorten_unknown function" with the epub file inside this folder.
So, it looks like the function "shorten" is not recognized or not valid for the parameter author_sort.
When I look at the help file http://manual.calibre-ebook.com/template_lang.html, to me, it looks like it should work. Or is my understanding still too limited? Or a bug or...?

Many thanks for any further info,
Capricorn
Capricorn is offline   Reply With Quote
Old 07-19-2013, 07:59 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,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Capricorn View Post
Hi Chaley,

Thanks for that tip. I did not know it worked in that sequence.

I changed the config of the device to:
{author_sort: shorten (80, -, 20)}/{title} - {series_index} {series}

and then I tried. What I found on the device, was a folder named "shorten_unknown function" with the epub file inside this folder.
So, it looks like the function "shorten" is not recognized or not valid for the parameter author_sort.
When I look at the help file http://manual.calibre-ebook.com/template_lang.html, to me, it looks like it should work. Or is my understanding still too limited? Or a bug or...?

Many thanks for any further info,
Capricorn
The problem is the space after the "shorten". Calibre assumes that it is part of the function name. Although this isn't really a bug, it is silly behavior and I will change it.

Remove the space and it should work. Also note that the spaces around the minus are significant -- they will be in the output.
chaley is offline   Reply With Quote
Old 07-20-2013, 01:11 AM   #5
Capricorn
Belgian Pommes Frites
Capricorn will become famous soon enoughCapricorn will become famous soon enoughCapricorn will become famous soon enoughCapricorn will become famous soon enoughCapricorn will become famous soon enoughCapricorn will become famous soon enough
 
Posts: 101
Karma: 532
Join Date: Jan 2012
Device: Pocketbook Touch HD
Hi Chaley,

Thank you very much for posting, as I would NOT have thought of those blanks as the problem.

I first tried this syntax:
{author_sort: shorten(80,-,20)}/{title} - {series_index} {series}
but it still gave a folder with the name "shorten_unknown function".

Then I tried the syntax:
{author_sort:shorten(80,-,20)}/{title} - {series_index} {series}
and lo and behold. It worked as I wanted it to. The epub file now opens on my reader. Simply brilliant.

Thank you very much for helping me out.
Capricorn
Capricorn is offline   Reply With Quote
Advert
Old 07-20-2013, 02:51 AM   #6
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,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Capricorn View Post
Thank you very much for helping me out.
Capricorn
You are welcome.

Apologies for not noticing the space at the front. That also has been fixed, for release next week.
chaley is offline   Reply With Quote
Reply

Tags
length, send to device, syntax, template


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem seeing/sending to device jans52 Devices 3 09-15-2011 01:49 PM
Sending Ebooks to Device. ErikaGC Devices 1 08-11-2011 04:40 PM
Sending magazines to Device mitch13 Library Management 1 04-04-2011 10:17 AM
Sending E-Books to Device Lady Fitzgerald Calibre 3 05-16-2010 03:43 PM


All times are GMT -4. The time now is 06:26 AM.


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