Problem manipulating the "series"-expression

All about user-defined episode / movie / file name format expressions
Post Reply
rogergh
Posts: 4
Joined: 11 Dec 2016, 22:48

Problem manipulating the "series"-expression

Post by rogergh »

Hi.

I have a problem when trying to manipulate the "series"-expression which returns the aniDB ID for series. I just can't get it to replace the "::" from the value with "-". This is what I use for testing:

Code: Select all

({series.replaceAll(/[:|]/, "-")})
This is a screenshot of the error with syntax and example file values (text is really small on a 4K monitor):

http://imgur.com/a/PjE0H

It is probably some noob error on my part, so any help would be appreciated :)
User avatar
rednoah
The Source
Posts: 23002
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Problem manipulating the "series"-expression

Post by rednoah »

If you want the id then I recommend using the {id} binding.
:idea: Please read the FAQ and How to Request Help.
rogergh
Posts: 4
Joined: 11 Dec 2016, 22:48

Re: Problem manipulating the "series"-expression

Post by rogergh »

That worked, thanks!

Any reason the "series"-expression exists and can't be manipulated?
User avatar
rednoah
The Source
Posts: 23002
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Problem manipulating the "series"-expression

Post by rednoah »

You assume that all bindings are String objects. This is not the case. The {series} binding will give you a SeriesInfo object. The series info object has many properties, not just a single text value.

e.g.

Code: Select all

series.properties

Code: Select all

series.class

Code: Select all

series.toString().class
:idea: Please read the FAQ and How to Request Help.
Post Reply