Page 1 of 1

Expression Help - Cut Episode Names

Posted: 28 Dec 2021, 11:15
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.

Re: Expression Help - Cut Episode Names

Posted: 28 Dec 2021, 11:38
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) }

Re: Expression Help - Cut Episode Names

Posted: 28 Dec 2021, 19:16
by Marius
works perfectly
thanks a lot for your help