Limiting length with v4.7.9 with Windows 7? and ifEmpty?

All about user-defined episode / movie / file name format expressions
Post Reply
UPdn
Posts: 2
Joined: 03 Apr 2020, 13:49

Limiting length with v4.7.9 with Windows 7? and ifEmpty?

Post by UPdn »

I'd like to add the actors clause to my Movies renaming recipe. I'd like to limit it to three names (guess that would be six words). But I suspect that isn't possible. I did try {actors.take(80)}. Doesn't seem to have any impact. Is there something I am missing in terms of the function? Maybe it doesn't work with the version I am using.

A Second question if I may. There are clauses that are empty. Whether it's a ratings clause or a languages clause or a director's clause. Is there an IfEmpty({director},"",{director}) or something like it?

Thank you.
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Limiting length with v4.7.9 with Windows 7? and ifEmpty?

Post by rednoah »

1.
Please use the latest version of FileBot.


2.
{actors.take(80)} will take the first 80 actors, which is likely all actors. {actors.take(3)} taking the first handful of actors is probably better, and should keep length below 80 chars.

If you're keen on the 80 chars, then {actors.join(', ').take(80)} will do.


3.
This thread will explain how errors (e.g. empty bindings) work and how to catch them and use default values instead:
viewtopic.php?t=1895
:idea: Please read the FAQ and How to Request Help.
UPdn
Posts: 2
Joined: 03 Apr 2020, 13:49

Re: Limiting length with v4.7.9 with Windows 7? and ifEmpty?

Post by UPdn »

Thank you RedNoah

I started experimenting with your notes and satisfied my main urge. I still don't have a handle on compressing missing info, but that's another task for another day. Not trying to list the first EIGHTY named actors in the movie proved very satisfying. I still have a distance to travel in terms of understanding the language. UPdn.
Post Reply