Certain info not working in custom AMC format

Support for macOS users
Post Reply
gwenhidwy
Posts: 3
Joined: 01 Apr 2018, 01:46

Certain info not working in custom AMC format

Post by gwenhidwy »

I have been using filebot for ages and have an automated amc script I have been using for many years. Several months ago certain parts of the format stopped populating. This includes the audio language, audio codec, genres and movie rating. It seems like the matchAll for the file path such as WEB, WEBDL, etc is not working either. I am not really sure what these all have in common. The formats work fine in the regular app both on windows and mac. But I would much rather have everything work automatically.

I will include the formats but there are rather lengthy.

TV:

Code: Select all

/mnt/media/{file.path.contains('2160p') ? '4k' : file.path.contains('anime') ? 'anime' : 'tv'}/{norm = {it.replaceAll(/[`´‘’ʻ""“”]/, "'").replaceAll(/[:|]/, " -").replaceAll(/[?]/, "!").replaceAll(/[*]/, "#").replaceAll(/\b[IiVvXx]+\b/, { it.upper() }).replaceAll(/\b[0-9](?i:th|nd|rd)\b/, { it.lower()})}; norm(n)}{if (norm(n) != norm(primaryTitle)) ' ('+norm(primaryTitle)+')'}/{episode.special ? 'Specials' : 'Season '+s.pad(1)}/{norm(n)} - {episode.special ? 'S00E'+special.pad(2) : s00e00}{file.path.match(/(?i:director.*cut)/) ? '- Director\'s Cut ' : ''} [{vf}{file.path.matchAll(/(Blu-ray|Blu-Ray|BluRay|Bluray|bluray|blu-ray)/) ? ' BluRay' : '' }{file.path.matchAll(/SDTV|PDTV|pdtv|SD.TV|sdtv|sd.tv/) ? ' SDTV' : ''}{file.path.matchAll(/BDRIP|bdrip|BD-RIP|bd-rip|BD.RIP|bd.rip/) ? ' BD-RIP' : ''}{file.path.matchAll(/SD.DVD|DVD|DVDRip|DVDRIP|dvdrip|dvd|sddvd|sd.dvd|VHS|vhs/) ? ' SD DVD' : ''}{file.path.matchAll(/HDTV|HD.TV|hdtv|hd.tv/) ? ' HDTV' : ''}{file.path.matchAll(/webdl|web.dl|web-dl|WEBDL|WEB-DL|WEBRip|webrip|WEBrip|WEBRIP|WEB|Web|web|WEB.DL/) ? ' WEB-DL' : ''}]{(file.path.contains('anime') || media.AudiolanguageList.contains('Japanese') || file.name =~ "[\\(\\[]\\p{XDigit}{8}[\\]\\)]") ? (media.AudiolanguageList.contains('Japanese') && media.AudiolanguageList.contains('English')) ? ' (Dual Audio) - ' : media.AudiolanguageList.contains('English') ? ' (Eng Dub) - ' : media.AudiolanguageList.contains('Japanese') ? ' (Eng Sub) - ' :  "" : "" } {norm(t)}{file.path.matchAll(/PROPER|proper|Proper/) ? ' - Proper' : ''}{file.path.matchAll(/REPACK|repack|Repack/) ? ' - Repack' : ''} [{vc} {ac} {lang.upper()} {channels+'ch'}]
Movies:

Code: Select all

/mnt/6tbraid/movies/{n.replaceAll(/[`´‘’ʻ""“”]/, "'").replaceAll(/[:|]/, " - ").replaceAll(/[?]/, "!").replaceAll(/[*\s]+/, " ").replaceAll(/\b[IiVvXx]+\b/, { it.upper() }).replaceAll(/\b[0-9](?i:th|nd|rd)\b/, { it.lower()})} ({y}) {fn.match(/(?i:criterion.cut)/) ? '- Criterion Cut '  : ''}{fn.match(/(?i:director.*cut)/) ? '- Director\'s Cut ' : ''}{file.path.matchAll(/(?i:final.cut)/) ? '- Final Cut ' : ''}{file.path.matchAll(/part\s?\d|pt\s?\d|cd\s?\d/)*.upperInitial()*.lowerTrail().join(' ').replaceAll(/[.]/, " ").replaceAll(/Pt\s?|Cd\s?|CD\s?|Part\s?/, "Part") + ' '}{'(' + file.path.matchAll(/uncut|4k|extended|edition|uncensored|remastered|unrated|special[ ._-]edition/)*.upperInitial()*.lowerTrail().join(' ').replaceAll(/[.]/, " ") + ') '}[{vf}{file.path.matchAll(/(Blu-ray|Blu-Ray|BluRay|Bluray|bluray|blu-ray)/) ? ' BluRay' : '' }{file.path.matchAll(/SDTV|SD.TV|sdtv|sd.tv/) ? ' SDTV' : ''}{file.path.matchAll(/BDRIP|bdrip|BD-RIP|bd-rip|BD.RIP|bd.rip/) ? ' BD-RIP' : ''}{file.path.matchAll(/SD.DVD|DVD|SD DVD|DVDRip|DVDRIP|dvdrip|dvd|sddvd|sd.dvd/) ? ' SD DVD' : ''}{file.path.matchAll(/HDTV|HD.TV|hdtv|hd.tv/) ? ' HDTV' : ''}{file.path.matchAll(/webdl|web.dl|web-dl|WEBDL|WEB-DL|WEBRip|webrip|WEBrip|WEBRIP|WEB.DL/) ? ' WEB-DL' : ''}]{(file.path.contains('anime') || media.AudiolanguageList.contains('Japanese') || file.name =~ "[\\(\\[]\\p{XDigit}{8}[\\]\\)]") ? (media.AudiolanguageList.contains('Japanese') && media.AudiolanguageList.contains('English')) ? ' (Dual Audio)' : media.AudiolanguageList.contains('English') ? ' (Eng Dub)' : media.AudiolanguageList.contains('Japanese') ? ' (Eng Sub)' :  "" : "" } {file.path.matchAll(/PROPER|proper|Proper/) ? '- Proper' : ''}{file.path.matchAll(/REPACK|repack|Repack/) ? '- Repack' : ''} [{vc.contains('AVC') ? 'x264' : vc} {audio.collect{ aud -> allOf{aud.codec}{aud.language.upper()}{aud.channels+'ch'} }*.join(' ').join(', ').replaceAll(/AAC LC-SBR/, "AAC").replaceAll(/AAC LC/, "AAC").replaceAll(/MPA1L3/, "MP3").replaceAll(/MPA2L3/, "MP3").replaceAll(/Vorbis/, "OGG").replaceAll(/A_AC3/, "AC3").replaceAll(/A_DTS/, "DTS").replaceAll(/\//, "-")}]{fn.match(/.sdh/) ? '.SDH' : ''} [{genres.collect{ it[0..2] }.join(",")}] ({rating})
Here is the sysinfo output

Code: Select all

FileBot 4.7.9 (r4984)
JNA Native: 5.1.0
MediaInfo: 0.7.93
7-Zip-JBinding: 9.20
Chromaprint: 1.4.2
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2018-03-16 (r516)
Groovy: 2.4.10
JRE: Java(TM) SE Runtime Environment 1.8.0_162
JVM: 64-bit Java HotSpot(TM) 64-Bit Server VM
CPU/MEM: 8 Core / 3 GB Max Memory / 24 MB Used Memory
OS: Mac OS X (x86_64)
Package: APP
uname: Darwin gwenhyvar 15.6.0 Darwin Kernel Version 15.6.0: Tue Jan 30 11:45:51 PST 2018; root:xnu-3248.73.8~1/RELEASE_X86_64 x86_64

------------------- UPDATE AVAILABLE: FileBot 4.7.19 (r5271) -------------------

Done ヾ(@⌒ー⌒@)ノ
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Certain info not working in custom AMC format

Post by rednoah »

Can you isolate the bits and pieces of the format that don't work as expected?

Your format is not humanly readable or debuggable in it's current form. The first step is to isolate the bindings that don't yield the expected value.

e.g.

Code: Select all

audio.language

:idea: If you have copy & pasted the format from the forums here, and don't really understand how it works, then it'll be extremely difficult to solve problems. I myself would have to build up the format from scratch step by step to figure out which part isn't working.
:idea: Please read the FAQ and How to Request Help.
gwenhidwy
Posts: 3
Joined: 01 Apr 2018, 01:46

Re: Certain info not working in custom AMC format

Post by gwenhidwy »

Some of the format has been copied for the forum but most of it has been built up by myself over several years. I can understand not being able to decipher it but I know how every part of it works.

Here a examples of expressions in the format that work in the app but not in the CLI:
  • file.path
    This part of the expression matches words in the file path and replaces them accordingly

    Code: Select all

    {file.path.matchAll(/(Blu-ray|Blu-Ray|BluRay|Bluray|bluray|blu-ray)/) ? ' BluRay' : '' }
    if I replace this with

    Code: Select all

    {fn.matchAll(/(Blu-ray|Blu-Ray|BluRay|Bluray|bluray|blu-ray)/) ? ' BluRay' : '' }
    it will work when it matches the filename but that is not what I am looking for.
  • audio info

    Code: Select all

    audio.collect{ aud -> allOf{aud.codec}{aud.language.upper()}{aud.channels+'ch'} }*.join(' ').join(', ')}
    not sure if there is an issue with the collect but all of theses parts work flawlessly in the app.
  • genres

    Code: Select all

    {genres.collect{ it[0..2] }.join(",")}
  • rating

    Code: Select all

    {rating}
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Certain info not working in custom AMC format

Post by rednoah »

Which part is not working as expected? What is the value you get? What is the value you want? Are you using the Format Editor GUI for testing? Is there any message in the Format Editor that might hint at a problem? What files are you using for testing?
:idea: Please read the FAQ and How to Request Help.
gwenhidwy
Posts: 3
Joined: 01 Apr 2018, 01:46

Re: Certain info not working in custom AMC format

Post by gwenhidwy »

I have to apologize. I started trying to test just parts of the format and discovered that there was an issue with the symbolic link to the script. For some reason it was not reflecting the changes that were being made in the file. After some more troubleshooting everything is working as expected. Sorry to have bothered you.

Thank you for your help though. You did help me solve this problem in the end.
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Certain info not working in custom AMC format

Post by rednoah »

Yet another reason to always use the Format Editor GUI for prototyping and testing. ;)
:idea: Please read the FAQ and How to Request Help.
Post Reply