Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old Today, 05:03 PM   #1
glazedbelmont
Junior Member
glazedbelmont began at the beginning.
 
glazedbelmont's Avatar
 
Posts: 4
Karma: 10
Join Date: Aug 2024
Device: BOOX Go Color 7
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; Today at 05:04 PM. Reason: I wanted to be more specific
glazedbelmont is offline   Reply With Quote
Old Today, 06:01 PM   #2
glazedbelmont
Junior Member
glazedbelmont began at the beginning.
 
glazedbelmont's Avatar
 
Posts: 4
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.
glazedbelmont is offline   Reply With Quote
Advert
Old Today, 07:53 PM   #3
glazedbelmont
Junior Member
glazedbelmont began at the beginning.
 
glazedbelmont's Avatar
 
Posts: 4
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
Attached Files
File Type: txt calibre_export_filenames.txt (482 Bytes, 1 views)
glazedbelmont is offline   Reply With Quote
Reply

Tags
calibre, template, template creation, template error


Forum Jump

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


All times are GMT -4. The time now is 08:32 PM.


MobileRead.com is a privately owned, operated and funded community.