Can you access template functions from python with the `inline` plugin?

I’m wondering if it’s possible to use template functions like %aunique from inline python (inline plugin) in a path format. Thanks!

-kergoth

Not directly, unfortunately! But you might be able to invoke the underlying Python functions:

I don’t think that’s a viable option, since tmpl_aunique isn’t a staticmethod, so requires the item and lib to construct the object, which I doubt you can do from inside an inline python block. Is that correct, or is there a way to get to the library object from album_fields?

Indeed—it’s certainly not easily done, but perhaps with enough hacking you can construct your own Library object, linked to the appropriate database, to obtain the object you need.

This question came up again in another topic, with a solution posted there:

1 Like