Page 1 of 1

NORDIC included in the end of the name if the release have NORDIC in its name

Posted: 11 Aug 2022, 12:28
by Jerome2626
Hi I'm using these AMC scripts and would like to have NORDIC included in the end of the name if the release have NORDIC in its name.

Code: Select all

/storage/local/googleFi_crypt/media/{f =~ /kidsmovies/ ? 'kidsmovies' : 'movies'}/{n} ({y})/{n} ({y}){' CD'+pi}{'.'+lang}

Code: Select all

/storage/local/googleSh_crypt/media/tv/{n} ({y})/{'Season '+s.pad(2)}/{n} - {s00e00} - {t} ({source}-{vf}){'.'+lang}
An example: For All Mankind S03E06 NORDiC 1080p ATVP WEB-DL DD5 1 should be renamed to have NORDIC.

Re: NORDIC included in the end of the name if the release have NORDIC in its name

Posted: 11 Aug 2022, 16:23
by rednoah
e.g.

Code: Select all

{ fn.match(/NORDIC/) }
:arrow: viewtopic.php?t=12643



:idea: Alternatively, you can also re-use the Kids Movies if-then-else that you are already familiar with and adjust it for the task at hand:

Code: Select all

{ f =~ /NORDIC/ ? 'NORDIC' : '' }

Re: NORDIC included in the end of the name if the release have NORDIC in its name

Posted: 12 Aug 2022, 12:49
by Jerome2626
That works perfect for the second suggestion.
The first I couldn't get to work in the script.
Second question.
Can you also help since Filebot names WEB-DL-xxxx but I want WEBDL-xxxx since that's the Sonarr naming.
Thanks for the help.

Re: NORDIC included in the end of the name if the release have NORDIC in its name

Posted: 12 Aug 2022, 15:15
by rednoah
e.g.

Code: Select all

{ source.replace('WEB-DL', 'WEBDL') }


:idea: Alternatively, you can also re-use the Kids Movies if-then-else that you are already familiar with and adjust it for the task at hand:

Code: Select all

{ source =~ /WEB-DL/ ? 'WEBDL' : source }

Re: NORDIC included in the end of the name if the release have NORDIC in its name

Posted: 16 Aug 2022, 10:21
by Jerome2626
If I use the first suggestion I get
filename (WEB-dl-1080p) WEB-dl.mkv

Re: NORDIC included in the end of the name if the release have NORDIC in its name

Posted: 16 Aug 2022, 10:43
by Jerome2626
Got it working:)

Code: Select all

/storage/local/googleSh_crypt/media/tv/{n} ({y})/{'Season '+s.pad(2)}/{n} - {s00e00} - {t} ({ source.replace('WEB-DL', 'WEBDL') }-{vf}){'.'+lang} { fn.match(/NORDIC/) }

Re: NORDIC included in the end of the name if the release have NORDIC in its name

Posted: 16 Aug 2022, 10:44
by rednoah
The snippet above is of course just the code generates the WEBDL bit. You'll want to combine that with the format you already have that generate the other bits of the target file name.

e.g.

Code: Select all

/storage/local/googleSh_crypt/media/tv/
{n} ({y})/
{'Season '+s.pad(2)}/
{n} - {s00e00} - {t} 
({ source.replace('WEB-DL', 'WEBDL') }-{vf})
{ fn.match(/NORDIC/) }
{'.'+lang}

Re: NORDIC included in the end of the name if the release have NORDIC in its name

Posted: 16 Aug 2022, 10:50
by Jerome2626
Yes you are correct I got it working, just overlooked it. I'm not normally working with coding.
Thanks for an excellent program and support.