I have a bunch of files that when I use {source} it shows WEB, which is totally correct, but in the folder name its actually AMZN.WEBRip is there a way to properly get this from the original folder to use in place of {source} in the new file name? I've tried some regex's against {f} to see if it existed but had no luck being able to override {source} if the folder name had the correct source but the original file name did not.
Thank you!
edit forgot to mention I am currently using the GUI.
Need help with an example with folder file differences
-
- Posts: 14
- Joined: 19 Mar 2023, 02:21
-
- Posts: 14
- Joined: 19 Mar 2023, 02:21
Re: Need help with an example with folder file differences
Guess I did not get deep enough in the docs. This is at least working for my current scenario. I am going to leave in and see how it behaves in my usual processing.
Code: Select all
(source == 'WEB' ? (f.path.match(/WEBRip|WEBDL|WEB-DL/)) ?: "{${source}}" : "{${source}}")
Re: Need help with an example with folder file differences
Please always include the complete file path. We need it for testing. Please read How to Request Help.8i6juyhrggvf wrote: ↑18 Jul 2023, 23:29 I have a bunch of files that when I use {source} it shows WEB, which is totally correct, but in the folder name its actually AMZN.WEBRip is there a way to properly get this from the original folder to use in place of {source} in the new file name?
-
- Posts: 14
- Joined: 19 Mar 2023, 02:21
Re: Need help with an example with folder file differences
Code: Select all
Criminal.Minds.S12.1080p.AMZN.WEBRip.DD5.1.x264/Criminal.Minds.S12E11.1080p.WEB.H264.mkv
Criminal.Minds.S12.1080p.AMZN.WEBRip.DD5.1.x264/Criminal.Minds.S12E09.1080p.WEB.H264.mkv
My full crazy setup right now is
Code: Select all
/NewDir/
{ny.removeAll(/[!?.]+$|:/).replaceAll(/[`´''?]/, "'").replace('&', 'and').replaceTrailingBrackets().ascii()}
({y})
{ ' {tvdb-' + { id } + '}' }
{ ' {tmdb-' + tmdbid + '}' }
{ ' {imdb-' + { imdbid } + '}' }/
{regular ? 'Season ' + s.pad(2) : 'Specials'}/
{ny.removeAll(/[!?.]+$|:/).replaceAll(/[`´''?]/, "'").replace('&', 'and').replaceTrailingBrackets().ascii()}
({y}) -
{s00e00} -
{t.removeAll(/[!?.]+$|;|:|"|>/).replaceAll(/[`´'']/, "'").replace('&', 'and').replaceTrailingBrackets().ascii()}
{ " -{edition-${tags[0]}}" } -
{' {tvdb-' + { id } + '}' } -
{' {tmdb-' + tmdbid + '}' } -
{' {imdb-' + { imdbid } + '}' }
{"- {${airdate}}"}
{vf ? "- {${vf}}" : ''}
{ '-[' + (
(source == 'WEB' ? "{${f.path.find(/(?:ABC|ATVP|AMZN|BBC|CBS|CC|CR|CW|DCU|DSNP|DSNY|FBWatch|FREE|FOX|HMAX|HULU|iP|LIFE|MTV|NBC|NICK|NF|RED|TF1|STZ)[.-](?:WEBRip|WEBDL|WEB-DL)/) ?: source}}" : "{${source}}") +
(hd ? "-{${hd}}" : '') +
(vcf ? "-{${vcf}}" : '') +
(vc && !vc.contains('AVC') ? "-{${vc}}" : '') +
(aco ? "-{${aco}}" : '') +
(acf ? "-{${acf}}" : '') +
(any{"-{${hdr}}"}{'-{SDR}'}) +
(audioLanguages ? "-{${audioLanguages.join(",")}}" : '')
) + ']' }
Code: Select all
/NewDir/Criminal Minds (2005) {tvdb-75710} {tmdb-4057} {imdb-tt0452046}/Season 12/Criminal Minds (2005) - S12E09 - Profiling 202 - {tvdb-75710} - {tmdb-4057} - {imdb-tt0452046} - {2017-01-04} - {1080p}-[{AMZN.WEBRip}-{FHD}-{AVC}-{Dolby Digital Plus}-{DDP5.1}-{SDR}-{eng}].mkv
/NewDir/Criminal Minds (2005) {tvdb-75710} {tmdb-4057} {imdb-tt0452046}/Season 12/Criminal Minds (2005) - S12E12 - A Good Husband - {tvdb-75710} - {tmdb-4057} - {imdb-tt0452046} - {2017-02-08} - {1080p}-[{AMZN.WEBRip}-{FHD}-{AVC}-{Dolby Digital Plus}-{DDP5.1}-{SDR}-{eng}].mkv
Re: Need help with an example with folder file differences
Cheers. FileBot r9893 and above will not prefer longer pattern matches when matching values for the {vc} and {source} bindings.8i6juyhrggvf wrote: ↑19 Jul 2023, 06:41Code: Select all
Criminal.Minds.S12.1080p.AMZN.WEBRip.DD5.1.x264/Criminal.Minds.S12E11.1080p.WEB.H264.mkv Criminal.Minds.S12.1080p.AMZN.WEBRip.DD5.1.x264/Criminal.Minds.S12E09.1080p.WEB.H264.mkv
-
- Posts: 14
- Joined: 19 Mar 2023, 02:21
Re: Need help with an example with folder file differences
Does that mean source and vc going forward will always prefer WEB over WEBRip? Not sure I get what you mean, thanks!rednoah wrote: ↑19 Jul 2023, 09:32Cheers. FileBot r9893 and above will not prefer longer pattern matches when matching values for the {vc} and {source} bindings.8i6juyhrggvf wrote: ↑19 Jul 2023, 06:41Code: Select all
Criminal.Minds.S12.1080p.AMZN.WEBRip.DD5.1.x264/Criminal.Minds.S12E11.1080p.WEB.H264.mkv Criminal.Minds.S12.1080p.AMZN.WEBRip.DD5.1.x264/Criminal.Minds.S12E09.1080p.WEB.H264.mkv
Re: Need help with an example with folder file differences
I mistyped "now" as "not"... I meant to say that "AMZN.WEBRip" (11 chars) is now preferred over "WEB" (3 chars) based on String length.