Fetch Movie Artwork Collection
e.g. Fetch artwork and fanart for newly processed movie files:** requires FileBot r10652 or higher
Groovy: Select all
{ source, target, metadata ->
// select artwork and fanart
list{ movie.artwork }{ movie.fanart }
// filter out non-English artwork
.findAll{ a -> a.language == null || a.language ==~ /en/ }
// group by artwork type (e.g. posters, backdrops)
.groupBy{ a -> a.tags.join('_') }
.each{ group, artwork ->
// fetch the top 5 entries for each artwork type
artwork.take(5).eachWithIndex{ a, i ->
// target.dir is the movie folder
curl a.url, target.dir / 'artwork' / "${group}-${i+1}.${a.extension}"
}
}
}
Fetch Series Artwork Collection
e.g. Fetch artwork and fanart for newly processed series / episode files:** requires FileBot r10652 or higher
Groovy: Select all
{ source, target, metadata ->
// select artwork and fanart
list{ series.artwork }{ series.fanart }
// filter out non-English artwork
.findAll{ a -> a.language == null || a.language ==~ /en/ }
// group by artwork type (e.g. posters, backdrops, seasonposter/1, seasonposter/2, etc) but not artwork size (e.g. 1000x1500)
.groupBy{ a -> a.tags.grep(~/[a-z]+|[0-9]+/).join('_') }
.each{ group, artwork ->
// fetch the top 5 entries for each artwork type
artwork.take(5).eachWithIndex{ a, i ->
// target.dir.dir is the series folder
curl a.url, target.dir.dir / 'artwork' / "${group}-${i+1}.${a.extension}"
}
}
}
List Artwork Collection
e.g. List all available artwork:Groovy: Select all
{ source, target, metadata ->
list{ movie.artwork }{ movie.fanart }{ series.artwork }{ series.fanart }
.each{ a -> println a }
}