I just started to code with filebot. I want to sort everything in a weighted genre folder. At the moment I am struggling with collections, because if I try to sort them, then the non-series-movies will not be sorted under a genre file. Before I started to involve collections everything worked fine, but series movie have sometimes different genres so they are not sorted right or they will be sorted under differen genres with the same collection-folder-name. Can someone help? I tried a lot even with ChatGpt
Groovy: Select all
movies/
{def genreOrder = ['Animation': 1, 'Comedy': 2, 'Horror': 3, 'Science-Fiction': 4, 'Fantasy': 5, 'Romance': 6, 'Drama': 7, 'Action': 9, 'Thriller': 8].withDefault{ 100 }
def sortedGenres = genres.toSorted{ genreOrder[it] }
def collectionGenre = collection ? model.findAll{ it.collection == collection }.collectMany{ it.genres }.unique().min{ genreOrder[it] } : sortedGenres[0]
'Marvel Studios' in info.productionCompanies ? 'Marvel/' : collectionGenre + '/'}
/
{collection = {it.lowerTrail().replaceTrailingBrackets().replaceAll(/[`´‘’ʻ""“”]/, "'").replaceAll(/[:|]/, " - ").replaceAll(/[*\s]+/, " ").replaceAll(/^(The)\s(.+)/i, /$2, $1/)}}
{collection}/{model.findAll{ it.collection == collection }.sort{ it.d }.findIndexOf{ it.id == id } + 1 + '. '}
{n} ({y})
/
{n} ({y}) [{vf} {fn.match(/3D|Extended|Special Edition|Unrated|Uncensored|Remastered/) ? fn.match(/3D|Extended|Special Edition|Unrated|Uncensored|Remastered/) : ""} {vc} {ac} {af}]