Need little help with conflict groovy script
Posted: 29 Jun 2023, 04:55
Hi all,
we have a vast media collection in which there are often times multiple resolutions and codecs available and i want filebot to only keep the one with the highest resolution and when there are several files with the same resolution it should favor HEVC files.
viewtopic.php?t=12891 according to this i came up with this:
I'm used to test formats with the filebot GUI but afaik there's no easily accessible possibility to test this kind of code and I'm not sure how to link the two scores together so filebot considers them in a correct way.
Any help is highly appreciated, thanks in advance
we have a vast media collection in which there are often times multiple resolutions and codecs available and i want filebot to only keep the one with the highest resolution and when there are several files with the same resolution it should favor HEVC files.
viewtopic.php?t=12891 according to this i came up with this:
Groovy: Select all
{ from, to ->
def score =
{ f -> ['2160p':30, '1080p':20, '720p':10][f.mediaCharacteristics.videoFormat] ?: 0 }
{ f -> ['HEVC':20, 'AVC':10][f.mediaCharacteristics.videoCodec] ?: 0 }
score(from) > score(to) ? to : null
}
Any help is highly appreciated, thanks in advance