View Single Post
Old 08-22-2024, 05:03 PM   #1
glazedbelmont
Member
glazedbelmont began at the beginning.
 
glazedbelmont's Avatar
 
Posts: 19
Karma: 10
Join Date: Aug 2024
Device: Go Color 7, Libra 2
Post 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
glazedbelmont is offline   Reply With Quote