08-22-2024, 05:03 PM | #1 |
Member
Posts: 15
Karma: 10
Join Date: Aug 2024
Device: BOOX Go Color 7
|
Help with template
Hello,
I'm genuinely trying to wrap my head around calibre's template functions but basically what I want to do is include the title in the filename IF it differs from the series (mangas usually don't have title, they only go by "series #number" and in calibre, they're named the same as the series so I can't use a simple check to see if it exists.). For example: A book should display like this due to having an actual title A manga should display like this I may be critically misunderstanding how it all works but this is what I have going which well, doesn't work, from what I could gather, I shouldn't be using {var} but instead $var but this only leads to errors What I had going was: {series}/{series}{series_index:0>2s| - Vol. |} {series:contains({title},,- {title})} but this ends up failing on some stuff, I tried swapping out for $title instead but this leads to errors too. The error given is: To be specific, this is a template to save to a device from the "Configure [device] screen" Any help? Last edited by glazedbelmont; 08-22-2024 at 05:04 PM. Reason: I wanted to be more specific |
08-22-2024, 06:01 PM | #2 |
Member
Posts: 15
Karma: 10
Join Date: Aug 2024
Device: BOOX Go Color 7
|
Ok so I delved into it a bit deeper, I see what I need to do, my task was basically way too complex for this function.
|
Advert | |
|
08-22-2024, 07:53 PM | #3 |
Member
Posts: 15
Karma: 10
Join Date: Aug 2024
Device: BOOX Go Color 7
|
OK so I went and fixed my issue, python mode just worked perfectly. I've attached the template for people to use if they ever want to do what I wanted to do and can't figure it out
|
Tags |
calibre, template, template creation, template error |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Template: saving template tester when restarting Calibre | ownedbycats | Library Management | 14 | 03-29-2021 05:57 PM |
Template: Converting a search & replace into a template | ownedbycats | Library Management | 11 | 03-26-2021 04:32 AM |
"Normal" template inside GPM template | ownedbycats | Library Management | 20 | 12-02-2020 09:40 PM |
Using built-in template functions in a custom template function | ilovejedd | Library Management | 4 | 01-28-2018 12:20 PM |