Possible to Shorten Series Name with Formatting?

Any questions? Need some help?
Post Reply
canisdibellum
Posts: 4
Joined: 11 Jun 2022, 22:21

Possible to Shorten Series Name with Formatting?

Post by canisdibellum »

Going through, I'm finding shows (especially anime) where the names are ridiculously long and I'm wondering if there is a way to shorten the series name for the episode titles?

Like shortening the series name: Re ZERO, Starting Life in Another World
To: Re Zero

so I'd be going from episode names like: Re ZERO, Starting Life in Another World - S01E01 - 1 - The End of the Beginning and the Beginning of the End.1080p
to just: Re ZERO - S01E01 - 1 - The End of the Beginning and the Beginning of the End.1080p

I'm sure there are ways to set a trim and look for a delimiter like a comma in the above example, however, not all of the shows I'm talking about have a comma in them, sometimes its a colon or other, and sometimes the show's short name would even have a colon (Re ZERO like above is actually Re: ZERO) so I don't think having it cut at punctuation would be the play here. is there like an object property (like {n}) that has a shorter name inside?

This is the format I usually use for these shows:

Code: Select all

X:\Anime\{n}\{episode.special ? 'Specials' : 'Season '+s.pad(2)}\{n} - {s00e00} -{sc > 1 ? ' '+absolute+' -' : null} {t}.{vf}
Sorry for the long-ish post
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Possible to Shorten Series Name with Formatting?

Post by rednoah »

e.g. before punctuation followed by space:

Code: Select all

{ n.before(/\p{Punct}\p{Space}/) }

:!: Re: ZERO, Starting Life in Another World is difficult though, because you can't really distinguish between the first ": " and the second ", " and so in this case you need to pick one, or consider a different approach entirely:

Code: Select all

$ filebot -list --q 305089 --db TheTVDB --format '{ n.before(/, /) } | {sxe} | {t}'
Re: ZERO | 1x01 | The End of the Beginning and the Beginning of the End
...

:idea: You can try the alias binding to retrieve all the known aliases, and then pick the shortest one from there, but it likely won't be the one you want, but some short name or abberviation:

Code: Select all

{ alias.min{ it.length() } }
:idea: Please read the FAQ and How to Request Help.
canisdibellum
Posts: 4
Joined: 11 Jun 2022, 22:21

Re: Possible to Shorten Series Name with Formatting?

Post by canisdibellum »

Thank you so much for getting back to me. I will have to see if I can find something that works. Thanks so much!
Post Reply