Expression Help - Cut Episode Names

All about user-defined episode / movie / file name format expressions
Post Reply
Marius
Posts: 2
Joined: 28 Dec 2021, 11:07

Expression Help - Cut Episode Names

Post by Marius »

Hi there,
first of all, sorry for my english.

I use the following syntax for grabbing episodes from TheTVDB

Code: Select all

v:/{ (~emby>> az).ascii() }{dc > 1 ? " - part$di" : null}
But there are episode names that are too long for the linux filesystem. To cut the names i wanted to use

Code: Select all

.take(100)
---------------------------------------------------

Sadly, I am not able to merge both expressions.

Code: Select all

v:/{ (~emby>> az).ascii().take(100)}{dc > 1 ? " - part$di" : null}
doesn't give a result.

Thanks a lot for your help.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Expression Help - Cut Episode Names

Post by rednoah »

take() doesn't work on File objects, so you need to convert it to a String first:

Code: Select all

{ emby.ascii().toString().take(100) }
:idea: Please read the FAQ and How to Request Help.
Marius
Posts: 2
Joined: 28 Dec 2021, 11:07

Re: Expression Help - Cut Episode Names

Post by Marius »

works perfectly
thanks a lot for your help
Post Reply