Checking if any fields are present in mediainfo

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
devster
Posts: 417
Joined: 06 Jun 2017, 22:56

Checking if any fields are present in mediainfo

Post by devster »

I'm trying to look through mediainfo bindings to see if there are specific fields matching a regex.
The following, however, doesn't seem to work:

Code: Select all

video.first().findAll { k, v -> k ==~ /^colour_*/ }

Expression yields empty value: No signature of method: Script1160$_run_closure1.call() is applicable for argument types: (Entry) values: [Count=378]
Possible solutions: any(), any(), any(groovy.lang.Closure), tap(groovy.lang.Closure), each(groovy.lang.Closure), any(groovy.lang.Closure)
Any solutions?
I only work in black and sometimes very, very dark grey. (Batman)
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Checking if any fields are present in mediainfo

Post by kim »

Code: Select all

{
video.first().findAll { it =~ /^colour_.+/ }
}
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Checking if any fields are present in mediainfo

Post by rednoah »

You can specifically match the key like so:

Code: Select all

{video[0].findAll{ it.key =~ /^colour_/ }}
:idea: Please read the FAQ and How to Request Help.
Post Reply