How can I tweak sorty.groovy to download media artwork?

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
supertemp
Posts: 1
Joined: 20 May 2014, 00:29

How can I tweak sorty.groovy to download media artwork?

Post by supertemp »

I have installed filebot portable on a ReadyNas 104 following the RedNoah's post on how to install FileBot on anything (thank you!) and it's working great. I have got the sorty.groovy example script working to rename and move incoming media to the right folders, and get the subtitles.

The one thing I'd like to do here is to have it also download the artwork. I have run this

Code: Select all

filebot -script fn:artwork.tmdb '/data/Video/_New Movies/'
And it goes great, but can I run the equivalent on one directory only (or per directory) in the sorty.groovy, rather than recurse the whole library after each batch run? I think that will be quicker (eventually), depending on how many folders are in the new movies folder?

In the sorty script, I am not sure if I should run the script before or after the rename function, could someone please give me the best way here? I'm not sure how to get the new folder name after the rename has occurred, to pass to the fn:artwork (or is there a better way).

This is from sorty

Code: Select all

movieDir.getFolders{ !it.hasFile{ incomplete(it) } && it.hasFile{ it.isVideo() } }.each{ dir ->
	println "Processing $dir"
	def files = dir.listFiles{ it.isVideo() }

	// fetch subtitles
	files += getSubtitles(file:files)

	// sort movies / subtitles
	rename(file:files, db:'TheMovieDB', format:movieFormat)
      //IS THIS THE BEST PLACE TO RUN THE ART DOWNLOAD SCRIPT? HOW CAN I GET THE NEW FOLDER NAME TO PASS TO IT?
      //filebot -script fn:artwork.tmdb NEW_FOLDER_NAME_HERE?
}

Thanks for filebot RedNoah, it's really great.
User avatar
rednoah
The Source
Posts: 23940
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How can I tweak sorty.groovy to download media artwork?

Post by rednoah »

When in doubt, just use the AMC script.

The AMC code also contains all the answers you need. But it'll be much easier to just use AMC as is.
:idea: Please read the FAQ and How to Request Help.
Post Reply