Bug - Existing custom preset does not work after 4.9.0

All your suggestions, requests and ideas for future development
Post Reply
Ashaneil
Posts: 3
Joined: 28 Mar 2020, 14:34

Bug - Existing custom preset does not work after 4.9.0

Post by Ashaneil »

Hi,
I have a custom preset that I created using snippets from the Episode / Movies section. Prior to 4.9, they worked fine. It is very possible that I made a mess somewhere but I have not changed the presets in last couple of months. Basically, the preset creates the folder but names the files with "].mkv" for mkv files. Media format does not matter.

System: Windows 10
Install Method: MSI
Original File Name - Sgt. Bilko 1996 BluRay 10Bit 1080p DD+5.1 H265-d3g.mkv

Screenshot - https://snipboard.io/QSa765.jpg

Custom Preset: https://pastebin.com/XLJWh7nb

F7 Output:

Code: Select all

mv\eng\x265.new\Sgt. Bilko 1996 10bit hevc-d3g\Sgt. Bilko 1996 BluRay 10Bit 1080p DD+5.1 H265-d3g.mkv	{"@type":"Movie","year":1996,"imdbId":117608,"tmdbId":9099,"language":"en","id":9099,"name":"Sgt. Bilko","aliasNames":[]}
F5 Output:

Code: Select all

FileBot 4.9.0 (r7234)
JNA Native: 6.1.0
MediaInfo: 19.09
7-Zip-JBinding: 9.20
Chromaprint: 1.4.3
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2020-03-16 (r625)
Groovy: 3.0.2
JRE: OpenJDK Runtime Environment 13.0.2
JVM: 64-bit OpenJDK 64-Bit Server VM
CPU/MEM: 12 Core / 12 GB Max Memory / 300 MB Used Memory
OS: Windows 10 (amd64)
STORAGE: NTFS [OS] @ 41 GB | NTFS [EVO840_1TB] @ 300 GB | NTFS [Data_1TB] @ 299 GB | NTFS [MassStorage_5TB] @ 831 GB | NTFS [WD-3TB] @ 1.5 TB | NTFS [WD-3TB] @ 62 GB 
DATA: C:\Users\User1\AppData\Roaming\FileBot
Package: MSI
License: FileBot License PX5939881 (Valid-Until: 2068-10-17)
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Bug - Existing custom preset does not work after 4.9.0

Post by rednoah »

Can you narrow down a minimal code snippet that doesn't work as expected?


:!: call is never a good idea. :lol:


:arrow: It's broken somewhere here, but this code makes no sense to me so I can't fix it either... :lol:

Code: Select all

call{''};
def lang = call{any{'.'+lang}{lang}}+{fn.matches(/(?i).+sdh.+/) ? '_SDH' : ''}{any{fn.match(/(?i)\(foreignpartsonly\)/)}{''}};
// Extension
def ext = call{'.'+ext};
// Call all the bindings to create the result
(call(main_title).replace(':', ';') + call(lang)).replaceAll(/null/,'')
Like what is this supposed to do?

Code: Select all

call{any{'.'+lang}{lang}}


EDIT:

If I change whatever this is:

Code: Select all

def lang = call{any{'.'+lang}{lang}}+{fn.matches(/(?i).+sdh.+/) ? '_SDH' : ''}{any{fn.match(/(?i)\(foreignpartsonly\)/)}{''}};
to this:

Code: Select all

def lang = allOf
	{'.'+lang}
	{fn ==~ /(?i).+sdh.+/ ? '_SDH' : null}
	{fn.match(/(?i)\(foreignpartsonly\)/)}
	.join()
then I at least don't get an immediate syntax error.
:idea: Please read the FAQ and How to Request Help.
Ashaneil
Posts: 3
Joined: 28 Mar 2020, 14:34

Re: Bug - Existing custom preset does not work after 4.9.0

Post by Ashaneil »

You, sir, give me too much credit. My pedigree is of a line cook - give me sample code and I will eventually make it work through trial and error but no guarantees. Months ago when I created the preset from bunch of sample code, it all made complete sense. Now, it may all be ancient greek.

I made some changes and it "works" - as in, so far, it is supposedly doing what it was doing before except for picking up any information on the audio. My sample filename is

Code: Select all

Midway 2019 BluRay 10Bit 1080p Dts-HD Ma7.1 H265-d3g
. Any suggestions on what I am missing?

Here are the updates - https://pastebin.com/BvzRqQ72

You mention in your comments that it never a good idea to use call. How would I change code and make it work without using call? If you could point me in the right direction, I would appreciate.

And thanks for quick response. Really appreciate it.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Bug - Existing custom preset does not work after 4.9.0

Post by rednoah »

Ashaneil wrote: 28 Mar 2020, 23:29 I made some changes and it "works" - as in, so far, it is supposedly doing what it was doing before except for picking up any information on the audio.
No idea. I don't know what the goal is, so I can't fix the code to make it achieve that goal.

Ashaneil wrote: 28 Mar 2020, 23:29 You mention in your comments that it never a good idea to use call. How would I change code and make it work without using call? If you could point me in the right direction, I would appreciate.
Well, I don't know why're using call. It does nothing the first ten times around. But it can be used to catch errors, in which case any / allOf is usually the way to go though. call just so happens to exist because it's used internally for any / allOf.


e.g. this is a very roundabout way:

Code: Select all

def space = call{' '};
of doing this:

Code: Select all

def space = ' '

e.g. this entire section does nothing, sure it runs some code, and yields a value, but that value is not used or assigned to a variable, so it's immediately discarded, so as far as the end result of your format is concerned, this contributes nothing:

Code: Select all

call{hd.matches(/(?i)SD/) ? '480p-720p/' : ' '}+
call{hd.matches(/(?i)HD/) ? '720p-1080p/' : ' '}+
call{hd.matches(/(?i)UHD/) ? '4k/' : ' '};
:idea: Please read the FAQ and How to Request Help.
Post Reply