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
Really basic script
Re: Really basic script
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/ }) }
-
- Posts: 181
- Joined: 09 May 2012, 23:35
Re: Really basic script
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!!
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
It's working how you want: hasVideoFile AND ( not hasFile A OR not hasFile B OR not hasFile C )