Help with this script filebot to fix and to work

Running FileBot from the console, Groovy / FileBot scripting, shell scripts, etc
Post Reply
uniqedumx
Posts: 11
Joined: 23 Aug 2021, 20:56

Help with this script filebot to fix and to work

Post by uniqedumx »

Hello friends I have this script

Code: Select all

G:\Unidades compartidas\Cinedriveonline\PELICULAS
/{
(genres.contains('Animación') ) 
			? '2.PELICULAS ANIMACION/'+ 
			n.colon(' - ').replaceAll(/[?]/, '¿').replaceAll(/[!]/, '¡') + 
			' (' + y + ') - ' + vf + ' [' + mbps + '] ' + {Languages}:
	

	'error/' + 
			Ny.colon(' - ').replaceAll(/[?]/, '¿').replaceAll(/[!]/, '¡')
}
Could you help me:
the output contains the folder with the same name as the example movie;

current result with script:
G: \ Shared drives \ Cinedriveonline \ PELICULAS \ 1.PELICULAS VARIAS / spiderman (2002) - 1080p [2.1Mbps] [eng] .mkv


Result to be achieved:
G: \ Shared drives \ Cinedriveonline \ PELICULAS \ 1.PELICULAS VARIAS / spiderman (2002) / spiderman (2002) - 1080p [2.1Mbps] [eng] .mkv
That the name of the folder spiderman (2002) is added
I tried adding {ny} / but I don't know where to add it or how ...


And also if it is possible to summarize this script of the second part to make it shorter

Code: Select all

	(hd == 'SD' ) 
			? '1.PELICULAS VARIAS'+ 
			n.colon(' - ').replaceAll(/[?]/, '¿').replaceAll(/[!]/, '¡') + 
			' (' + y + ') - ' + vf + ' [' + mbps + '] ' + {Languages}:
	(hd == 'UHD' && (bytes/1073741824).round(1) > 30 && bitrate >= 26000000) 
			? '1.PELICULAS VARIAS'+ 
			n.colon(' - ').replaceAll(/[?]/, '¿').replaceAll(/[!]/, '¡') + 
			' (' + y + ') - ' + vf + ' [' + mbps + '] ' + {Languages}:
	(hd == 'UHD' && (bytes/1073741824).round(1) < 30) 
			? '1.PELICULAS VARIAS'+ 
			n.colon(' - ').replaceAll(/[?]/, '¿').replaceAll(/[!]/, '¡') + 
			' (' + y + ') - ' + vf + ' [' + mbps + '] ' + {Languages}:
	(hd == 'HD' && vf == '720p' ) 
			? '1.PELICULAS VARIAS'+ 
			n.colon(' - ').replaceAll(/[?]/, '¿').replaceAll(/[!]/, '¡') + 
			' (' + y + ') - ' + vf + ' [' + mbps + '] ' + {Languages}:
	(hd == 'HD' && vf == '1080p' ) 
			? '1.PELICULAS VARIAS'+ 
			n.colon(' - ').replaceAll(/[?]/, '¿').replaceAll(/[!]/, '¡') + 
			' (' + y + ') - ' + vf + ' [' + mbps + '] ' + {Languages}:
	(hd == 'HD' && vf == '1080p' && (bytes/1073741824).round(1) > 15 && bitrate >= 18000000) 
			? '1.PELICULAS VARIAS' + 
			n.colon(' - ').replaceAll(/[?]/, '¿').replaceAll(/[!]/, '¡') + 
			' (' + y + ') - ' + vf + ' [' + mbps + '] ' + {Languages}:
uniqedumx
Posts: 11
Joined: 23 Aug 2021, 20:56

Re: Help with this script filebot to fix and to work

Post by uniqedumx »

He solucionado la primera parte, por lo que quedaria asi, pero me gustaria que la segunda parte se reduciera

Code: Select all

G:\Unidades compartidas\Cinedriveonline\PELICULAS
/{
(genres.contains('Animación') ) 
			? '2.PELICULAS ANIMACION/'+ 
			n.colon(' - ').replaceAll(/[?]/, '¿').replaceAll(/[!]/, '¡') + 
			' (' + y + ') / ' +
			n.colon(' - ').replaceAll(/[?]/, '¿').replaceAll(/[!]/, '¡') + 
			' (' + y + ') - ' + vf + ' [' + mbps + '] ' + {Languages}:
	

	(hd == 'SD' ) 
			? '1.PELICULAS VARIAS/'+ 
			n.colon(' - ').replaceAll(/[?]/, '¿').replaceAll(/[!]/, '¡') + 
			' (' + y + ') / ' +
			n.colon(' - ').replaceAll(/[?]/, '¿').replaceAll(/[!]/, '¡') + 
			' (' + y + ') - ' + vf + ' [' + mbps + '] ' + {Languages}:
	(hd == 'UHD' && (bytes/1073741824).round(1) > 30 && bitrate >= 26000000) 
			? '1.PELICULAS VARIAS/'+ 
			n.colon(' - ').replaceAll(/[?]/, '¿').replaceAll(/[!]/, '¡') + 
			' (' + y + ') / ' +
			n.colon(' - ').replaceAll(/[?]/, '¿').replaceAll(/[!]/, '¡') + 
			' (' + y + ') - ' + vf + ' [' + mbps + '] ' + {Languages}:
	(hd == 'UHD' && (bytes/1073741824).round(1) < 30) 
			? '1.PELICULAS VARIAS/'+ 
			n.colon(' - ').replaceAll(/[?]/, '¿').replaceAll(/[!]/, '¡') + 
			' (' + y + ') / ' +
			n.colon(' - ').replaceAll(/[?]/, '¿').replaceAll(/[!]/, '¡') + 
			' (' + y + ') - ' + vf + ' [' + mbps + '] ' + {Languages}:
	(hd == 'HD' && vf == '720p' ) 
			? '1.PELICULAS VARIAS/'+ 
			n.colon(' - ').replaceAll(/[?]/, '¿').replaceAll(/[!]/, '¡') + 
			' (' + y + ') / ' +
			n.colon(' - ').replaceAll(/[?]/, '¿').replaceAll(/[!]/, '¡') + 
			' (' + y + ') - ' + vf + ' [' + mbps + '] ' + {Languages}:
	(hd == 'HD' && vf == '1080p' ) 
			? '1.PELICULAS VARIAS/'+ 
			n.colon(' - ').replaceAll(/[?]/, '¿').replaceAll(/[!]/, '¡') + 
			' (' + y + ') / ' +
			n.colon(' - ').replaceAll(/[?]/, '¿').replaceAll(/[!]/, '¡') + 
			' (' + y + ') - ' + vf + ' [' + mbps + '] ' + {Languages}:
	(hd == 'HD' && vf == '1080p' && (bytes/1073741824).round(1) > 15 && bitrate >= 18000000) 
			? '1.PELICULAS VARIAS/' + 
			n.colon(' - ').replaceAll(/[?]/, '¿').replaceAll(/[!]/, '¡') + 
			' (' + y + ') / ' +
			n.colon(' - ').replaceAll(/[?]/, '¿').replaceAll(/[!]/, '¡') + 
			' (' + y + ') - ' + vf + ' [' + mbps + '] ' + {Languages}:

	'error/' + 
			Ny.colon(' - ').replaceAll(/[?]/, '¿').replaceAll(/[!]/, '¡')
}
kim
Power User
Posts: 1234
Joined: 15 May 2014, 16:17

Re: Help with this script filebot to fix and to work

Post by kim »

do something like this:

Code: Select all

{
def norm = {it.colon(' - ').replaceAll(/[?]/, '¿').replaceAll(/[!]/, '¡') + ' (' + y + ') / ' + it.colon(' - ').replaceAll(/[?]/, '¿').replaceAll(/[!]/, '¡') + ' (' + y + ') - ' + vf + ' [' + mbps + '] ' + {Languages}};

genres.contains('Animación') ? '2.PELICULAS ANIMACION/' + norm(n) : hd ? '1.PELICULAS VARIAS/' + norm(n)	: 'error/' + ny.colon(' - ').replaceAll(/[?]/, '¿').replaceAll(/[!]/, '¡')
}
uniqedumx
Posts: 11
Joined: 23 Aug 2021, 20:56

Re: Help with this script filebot to fix and to work

Post by uniqedumx »

Gracias me ha funcionado perfectamente

Thank you for the fix, thats awesome its work
Post Reply