eachMediaFolder retrieves only one folder

All your suggestions, requests and ideas for future development
Post Reply
lboregard
Posts: 2
Joined: 24 Jun 2012, 23:59

eachMediaFolder retrieves only one folder

Post by lboregard »

rednoah, i have a simple script that does "args.eachMediaFolder { dir -> println "Listing $dir" } ... but it only lists the first folder ???

i'm running the portable version doing ./filebot.sh -script "scrape.groovy" -trust-script "/Volumes/Storage/Output"

any ideas what could be the problem ?
lboregard
Posts: 2
Joined: 24 Jun 2012, 23:59

Re: eachMediaFolder retrieves only one folder

Post by lboregard »

well, now i know why ... after browsing over filebot's source code, i found that eachMediaFolder only returns folders that have files of "video" type.

How can i customize the list of video types ?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: eachMediaFolder retrieves only one folder

Post by rednoah »

What video filetypes are still missing? It's media.types in the jar. You can just do getFolders().findAll{...} and do what you wanna do.

e.g.

Code: Select all

args.getFolders{ it.hasFile{ it.hasExtension('avi', 'mkv') } }.each { dir ->
	println dir
}
or like this?

Code: Select all

def selection = args.getFiles{ it.hasExtension('avi', 'mkv') }

selection.mapByFolder().each { dir, fs ->
	println "$dir: $fs"
}
:idea: Please read the FAQ and How to Request Help.
Post Reply