10-15-2012, 08:33 AM | #1 |
Junior Member
Posts: 8
Karma: 10
Join Date: Sep 2011
Device: IQ pocketbook
|
Export to disk, using functions
Hi all,
I export all my ebooks to a file system, structed by folders. I have 2 ruleset for exporting : - Export by name : Code:
{authors:.1}/{authors}{series:| - |/{series_index:0>2s}} - {title} Code:
-Series-/{series}/{series_index:0>2s} - {title} \[{authors}\] Now, I would like to do all of this at one time, and I tried to look over functions, but somehow, when the query gets complicated, the export crashes : This works Code:
{tags:contains(By_series,-Series-/,{authors:.1}/)}{title} Code:
{tags:contains(By_series,-Series-/,{authors:.1}/{title}/)}{title} Code:
calibre, version 0.9.1 ATTENTION : Impossible d’enregistrer certains livres: Impossible d’enregistrer certains livres, Cliquer le bouton afficher les détails pour voir lesquels. Le Gardien de la Pierre Traceback (most recent call last): File "site-packages\calibre\library\save_to_disk.py", line 434, in save_serialized_to_disk File "site-packages\calibre\library\save_to_disk.py", line 306, in do_save_book_to_disk ValueError: A échoué à calculer le chemin pour enregistrer sur le disque. Modèle : {tags:contains(Export_Par_Serie,-Series-/,{authors:.1}/{title}/)}{title} Erreur : Incorrect number of arguments for function contains ... And 1 block like this for every ebook ... Code:
{tags:contains(By_series, -Series-/{series}/{series_index:0>2s} - {title} \[{authors}\], {authors:.1}/{authors}{series:| - |/{series_index:0>2s}} - {title}) Best regards, Thomas |
10-15-2012, 11:01 AM | #2 |
Grand Sorcerer
Posts: 11,950
Karma: 7225107
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
You are using a sub-template as a function argument, something that frequently breaks things. That is why the documentation for single function mode says you are not supposed to do that.
You should use general program mode. In GPM, your last template would be something close to: Code:
program: contains(field('tags'), 'By_series', template('-Series-/{series}/{series_index:0>2s} - {title} [{authors}]'), template('{authors:.1}/{authors}{series:| - |/}{series_index:0>2s} - {title}')) |
Advert | |
|
10-18-2012, 08:27 AM | #3 |
Junior Member
Posts: 8
Karma: 10
Join Date: Sep 2011
Device: IQ pocketbook
|
Hi,
Made a small mistake by willing to remove the "program:" ident, but after some 1 minute reading, I understood this was needed. So now my exports works perfectly. I also wanted to try some advanced features, but after some reading, since I never coded in anything else than vbs and powershell, I left my export as is. If I have 30 minutes to spend, I will try to look deeper at it and increase my regex skills. Regards Thomas |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Certain Functions of Calibre Not Working? | BasilGrows | Calibre | 1 | 06-08-2012 12:14 AM |
Functions not found when used in Export script | Arco Witter | Library Management | 8 | 09-24-2011 04:41 PM |
Most often used calibre functions | thearr | Calibre | 17 | 08-07-2011 02:44 PM |
what's the latest kindle? and functions? | nelson7lim | Amazon Kindle | 2 | 08-03-2010 08:09 PM |
New functions | poco06 | Calibre | 4 | 05-01-2010 01:39 PM |