1
0
Fork 0
filebot-presets/common/validations.groovy

38 lines
1.2 KiB
Groovy
Executable File

/** Tipo de archivo incorrecto **/
def isOnlyRelocate = {try{only_relocate} catch(e){false}}()
if (!isOnlyRelocate) {
if (ext==~/jpg|nfo|png|url/) {
return fn
}
else if (ext!="mkv" && ext!="avi" && ext!="mp4" && ext!="mpg") {
throw new Exception("[formato_fichero_noestarndar]")
}
//video problems
try {
video
} catch (e) {
throw new Exception("[video_roto]")
}
//no genere
try {
genres
} catch (err) {
throw new Exception("[genero_no_especificado]")
}
}
//*** Relocate Remux and UHD to Transcode input folder
def peso = bytes.toString().before(' ').toDouble()
def numericBps = (mbps.toString().before(' ').toDouble()*1000000).round()
def es1080 = vf ==~ '1080.'
def es1080Remux = peso > 15 && numericBps >= 18000000
//if (vf ==~ '2160.' || (es1080 && es1080Remux)) return root+"to_transcode/" + localize.Spanish.plex.name + '/' + fn
/* SANITY CHECK */
if (relocation && !sanityCheck(tmdbid))
return root + relocationFrom + "to_check_name/" + localize.Spanish.plex.name + '/' + fn
//return '@@@@@@ Names Sanity Check KO @@@@@@@ --> New name: '+localize.Spanish.n+' with tmdb='+tmdbid
/********************************/
def isMovie = {try{movie!=null} catch(e){false}}()
def isSerie = {try{series!=null} catch(e){false}}()