def root = {try {hardlink} catch (err) {false}}() ? '/data/media/tv/' : '/series/'
def tostay = folder.toString().contains('stay/')
def subfolder = tostay ? "stay/" : "main/"

def rutaSeries = root+ 'Series/' + (tostay ? 'stay/' : 'new/')
def ruta_docu = root+'Series_Docu/' + subfolder
def ruta_animacion = root+'Series_Animacio/' + subfolder
def ruta_anime = root+'Series_Anime/' + subfolder
def ruta_asia = root+'Series_Asia/' + subfolder
def ruta_antiguas = root+'Series_Retro/' + subfolder
def ruta_esp = root+'Series_Hispano/' + subfolder
def ruta_cat = root+'Series_Catala/' + subfolder
def ruta_latina = root+'Series_lat/' + subfolder
def ruta_teen = root+'Series_familiar/' + subfolder
def ruta_infantil = root+'Series_Infantil/' + subfolder
def ruta_programastv = root+'programas_tv/' + subfolder

def rutaKO = root+'error/'
def ruta = rutaSeries

try {