Running FileBot from the console, Groovy scripting, shell scripts, etc
rednoah
The Source
Posts: 23953 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 09 Jun 2017, 16:08
What type is
fs and what value does it have?
That'd be what I ask myself.
Code level debugging via forum message makes no sense. I cannot help you with these kinds of things. You'll need to figure it out yourself. It'd start by doing some basic Groovy tutorials to acquire some basic development and debugging abilities.
kim
Power User
Posts: 1251 Joined: 15 May 2014, 16:17
Post
by kim » 09 Jun 2017, 16:12
fs = [filepath+ filename]
fs.getClass() = class java.util.ArrayList
rednoah
The Source
Posts: 23953 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 09 Jun 2017, 16:13
kim wrote: ↑ 09 Jun 2017, 16:01
Is fs a File object? = yes
How did you come to that conclusion?
Hint: It's not. It's a List object that contains File objects.
The rest is up to you. I'll unsubscribe from this thread now.
EDIT: I see you figured it out. You'll be fine.
kim
Power User
Posts: 1251 Joined: 15 May 2014, 16:17
Post
by kim » 09 Jun 2017, 16:24
probably not the best way to do it, but it works, finally
I spend hours on this
Code: Select all
if (fs[0].metadata instanceof MultiEpisode){
log.fine "fs[0].metadata: ${fs[0].metadata}"
log.fine "fs[0].metadata: ${fs[0].metadata.episodes.id}"
}
I just don't get why when it worked in GUI + Groovy Pad and not in script ?