![]() |
#1 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Oct 2011
Device: none
|
Variable "Send to device" path
Hi everybody,
I want my calibre to find out if book comes in series and accordingly to answer choose from saving it to "author_sort" folder or "_series_" folder....please - where I catch wrong grip? Code:
{series:'test($, strcat("Knihy/_",field("series"),"_/",field("series_index"),". ",field("title")," (",field("author"),")"), strcat("Knihy/",field("author_sort"),"/",field("title")," (",field("author"),")"))'} |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,862
Karma: 7036057
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
I tried using your template in a custom column and it produced a result, so it isn't clear what your problem is. What problem are you are having? Where are you using that template when it doesn't do whatever you want?
As an aside, you might be better off using something like Code:
{series:'test($, template("Knihy/_[[series]]_/[[series_index]].[[title]] ([[author]])"), template("Knihy/[[author_sort]]/[[title]] ([[author]])"))'} Even better (for me) would be to use general program mode, letting you use {} instead of [[ ]] to bracket field references in the template. Code:
program: test(field('series'), template("Knihy/_{series}_/{series_index}.{title} ({author})"), template("Knihy/{author_sort}/{title} ({author})")) |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Oct 2011
Device: none
|
THANX A LOT! ..."general program" shows some error, but "[[]]" code works smoothly
![]() BTW: problem was program dont accepted my template and used last working template instead... PS: can I somehow detect biggest "series_index" for book in selected series, to automatically choose number of prefix zeros before series number? (e.g.: if in series of transfered book is some book labeled like "195-th part", than use for series_index 3 digits...) ....its no big deal, but for series like Coollorado westerns, Perry Rhodan, Ren Dhark.... there are tens/houndreds of storyes ![]() Last edited by cipesek; 11-20-2011 at 05:14 AM. |
![]() |
![]() |
![]() |
#4 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,862
Karma: 7036057
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#5 | |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Oct 2011
Device: none
|
This error:
Quote:
|
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,862
Karma: 7036057
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Thank you. That helped find a bug when using GPM templates in save-to-disk.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
"add metadata as 1st page" won't work on batch [send to device] | Bellychaser | Devices | 3 | 01-25-2011 03:25 PM |
Save cover upon "Send to device" | silentguy | Calibre | 1 | 11-17-2010 04:44 AM |
How to change "Send to device" without folders? | Skydog | Calibre | 12 | 05-23-2010 12:13 PM |
template for "send to device" customization | sbin | Calibre | 8 | 01-07-2010 07:22 AM |
"Send to device" problems with 0.5.14 / PRS-505 | TMF | Calibre | 0 | 06-14-2009 05:16 PM |