Page 1 of 1

Really basic script

Posted: 29 Jun 2013, 09:23
by part timer
So I know what I am asking for is simple day 1 groovy code, but scripting and I don't really get along. I'm looking for a script that I can point at one of my movie directories and grab a list of all folders with a video file in them and does not contain the files folder.jpg & poster.jpg& movie.tbn and then print the full path to the folder to my log file as I have no easy way right now to figure out which have all 3 except checking manually. Perfect for a script to do.

Thanks for reading

Re: Really basic script

Posted: 29 Jun 2013, 13:27
by rednoah
Something like:

Code: Select all

args.getFolders().findAll{ it.hasFile{ it.isVideo() } && (!it.hasFile{ it =~ /folder.jpg/ } || !it.hasFile{ it =~ /poster.jpg/ } || !it.hasFile{ it =~ /movie.tbn/ }) }

Re: Really basic script

Posted: 30 Jun 2013, 00:07
by part timer
Awesome! Thank you for the fast response. I haven't been able to try the script out yet, but I think I need to tweak it. I want all my folders to have those 3 files folder.jpg & poster.jpg & movie.tbn and I want to know all of the folders that DO NOT contain all 3.

So I guess I need a script that checks folders that don't have 1 OR the other OR the other (any folder that is missing at least one) and only list the folders once. Then I'll throw it to a log file.

I hope this makes sense and I think I just need an OR statement between each, right?

As always thank you again so much!!

Re: Really basic script

Posted: 30 Jun 2013, 06:12
by rednoah
It's working how you want: hasVideoFile AND ( not hasFile A OR not hasFile B OR not hasFile C )