The script that I leave below checks if the destination folder exists but ignores the final file so if I already send a file previously in another resolution and I scan another folder with a new resolution, it takes it as a duplicate since it checks only if the destination folder exists but the new file does not.
Code: Select all
{
def altPath = 'Z:/LIBDRIVE/@cinedriveonline/'
def mainPath = 'Z:/LIBDRIVE/@cinedriveonline/1 DE LA A-Z y NUMEROS/'
def fileInfo = " - $vf [$mbps] $Languages"
def norm = {it.colon(' - ').replaceAll(/[?]/, '').replaceAll(/[!]/, '').replaceAll(/[¿]/, '').replaceAll(/[¡]/, '')};
def allNorm(path, hard, dir, info){ path + hard + '/' + dir + '/' + dir + info };
def outFull = genres.contains('Animación') ? ( allNorm(altPath, '3 ANIMACION', norm(ny), fileInfo) ) : ( hd ? allNorm(mainPath, (n =~ /^(?i)[a-z]/ ? n[0] : '1 CON NUMERACION'), norm(ny), fileInfo) : altPath + '4 RENOMANUAL/'+ norm(ny) + '/' + fn )
!(outFull as File).parentFile.exists() ? outFull : allNorm(altPath, '5 DUPLICADA', norm(ny), fileInfo)
}