12-16-2011, 03:15 AM | #16 | |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Try using template program mode or general program mode. In general program mode, your templates would be something like the following. I haven't run them, so there might be a syntax error somewhere. folder_on_device_10 Script: Code:
program: folderOnDevice(field('title'), field('#genre'),field('series'), field('series_index'), field('#max_number_in_series'), 10) Script: Code:
program: folderOnDevice(field('title'), field('#genre'), field('series'), field('series_index'), field('#max_number_in_series'), 6) Code:
val = kwargs.get('title') genretext = kwargs.get('#genre') |
|
12-16-2011, 07:43 AM | #17 |
Member
Posts: 21
Karma: 10
Join Date: Jan 2010
Device: iRex iLiad
|
Thanks for answering and the idea of the arguments!!
Unfortunately the files are still dumped in the wrong folder, currently the folder has this name: program_ folderondevice(field('title'), field('#genre'),field('series'), field('series_index'), field('#max_number_in_series'), 10) File names are: de wetten van de magie 00 proloog - de aflossing.jpg de wetten van de magie 00 proloog - de aflossing.mobi etc. It's just weird that this does work with most books. I did not see any difference in the meta information of the books. However, currently it seems that all books are dumped in this wrong folder, so using 'program:' for the columns does not work. edit: It looks like the export script is evaluated to remove all characters that are illegal in files before it is evaluated for script/functions. However, when I use a '/' in the genre, I see it replaced with a '_' on exporting. Still the value of the column is ok. Is it possible to use the column value without it evaluating completely when exporting? (Since it has already been evaluated when Calibre started or meta information changed) edit2: I replaced everything as it was: function is still the same. Changed the column back to: {title:folderOnDevice({#genre},{series},{series_in dex},{#max_number_in_series},10)} also changed the export script to: {#folder_on_device_10:||/}{title} Now it works for each book!! Last edited by Arco Witter; 12-16-2011 at 08:02 AM. |
Advert | |
|
12-16-2011, 08:29 AM | #18 |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
The template "program: ..." not working is my fault. I must have broken composite column evaluation in save-to-disk at some point. I have submitted a fix.
You should change the folder_on_device_10 column to not use sub-templates once my change is released (next week probably). There are several ways that sub-templates can break, and tracing them can be exceedingly mysterious. |
12-16-2011, 08:31 AM | #19 |
Member
Posts: 21
Karma: 10
Join Date: Jan 2010
Device: iRex iLiad
|
This corner is mysterious indeed
I think I found out why some series are ok and some get exported to the wrong folder. When I use a series named 'De stalen rat' it is changed internally to 'Stalen rat, de' so maybe this happens with several other fields too. I changed the arguments, that works great. Also i will await a new version. Thanks for your great support!! |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Old Thread] Folder Structure | gplauche | Calibre | 29 | 02-13-2012 05:13 PM |
Send to Device (structure) | mgmueller | Calibre | 1 | 02-21-2010 01:54 PM |
Send to device folder structure? | Slite | Calibre | 2 | 01-09-2010 05:20 AM |
Folder structure doubt | Oletros | iRex | 3 | 01-01-2009 07:00 AM |
SD Folder structure | ctitanic | Amazon Kindle | 1 | 12-30-2007 12:48 PM |