Binding "group": undefined

Support for macOS users
Post Reply
mpegman
Posts: 19
Joined: 11 Feb 2023, 13:38

Binding "group": undefined

Post by mpegman »

There is a similar post on this from 2020, but I didn't find a solution in there.

I'm not able to retrieve the group of a file (although it is specified in the filename)... I'm now working around it by pattern matching the filename and putting the filename in the new name.

Code: Select all

{if (original =~ /NLKIDS/ && any{group}{null} == null ) {" [NLKIDS]"}}

Code: Select all

{if (original =~ /mercator/ && any{group}{null} == null ) {" [mercator]"}}
...

Code: Select all

FileBot 4.9.7 (r9130)
JNA Native: 6.1.2
MediaInfo: 21.09
Tools: fpcalc/1.5.1 7zz/21.06
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2022-08-15 (r836)
Groovy: 3.0.9
JRE: OpenJDK Runtime Environment 17.0.2
JVM: OpenJDK 64-Bit Server VM
CPU/MEM: 10 Core / 4.3 GB Max Memory / 447 MB Used Memory
OS: Mac OS X (x86_64)
HW: Darwin xyzMBP2.localdomain 22.2.0 Darwin Kernel Version 22.2.0: Fri Nov 11 02:03:51 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T6000 x86_64
STORAGE: xxxxxxxxx
DATA: /Users/xyz/Library/Containers/net.filebot.FileBot/Data/Library/Application Support/User Data
Package: MAS
License: Mac App Store License
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Binding "group": undefined

Post by rednoah »

:?: What is the original file name or current file name? What is the value of {original} and {fn} in cases where your code does not work as expected?


:idea: You can copy file names from FileBot into the clipboard with the F7 keyboard shortcut:
viewtopic.php?t=1868


:idea: Note that {original} refers to the original file names before renaming stored as xattr metadata. {original} notably does not refer to the current file name. Use the {fn} binding if you need the current file name.
:idea: Please read the FAQ and How to Request Help.
mpegman
Posts: 19
Joined: 11 Feb 2023, 13:38

Re: Binding "group": undefined

Post by mpegman »

I notice indeed that the group is not in the metadata when I press F7.
Is there a way to access this matter metadata and store data in it?

Code: Select all

Alloo bij de Wegpolitie {tvdb-288592}/Season 04/Alloo bij de Wegpolitie - S04E06 - Aflevering 6 (2018-11-29) [VTM] [0.0★][Audio - Dut 2.0 AAC][Video - MicroHD 1080p 8 bit web AVC] [mercator].mkv	{"@type":"Episode","seriesName":"Alloo bij de Wegpolitie","season":4,"episode":6,"title":"Aflevering 6","airdate":{"year":2018,"month":11,"day":29},"id":6910946,"seriesInfo":{"database":"TheTVDB","order":"Airdate","language":"nl-NL","type":"TV Series","id":288592,"name":"Alloo bij de Wegpolitie","aliasNames":[],"startDate":{"year":2014,"month":9,"day":4},"genres":["Documentary","Reality"],"network":"VTM","rating":0.0,"runtime":60,"status":"Ended"}}
mpegman
Posts: 19
Joined: 11 Feb 2023, 13:38

Re: Binding "group": undefined

Post by mpegman »

I get these warnings on undefined variables quite often.
{ subt }{ hdr }{ group }
all of them are examples... is this normal?

On more query on the bound variables.
I read in the documentation of 4.9.4 that country binding is added.
• Added {country} production country binding
as I use 4.9.7 I should be able to access it... however its always empty on TheTVDB; it is filled on themoviedb.
Is there a way to query both?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Binding "group": undefined

Post by rednoah »

"mercator" is not on the list and so {group} doesn't work. Please read Release Groups {group} for details on how {group} works. Notably, {group} is based on the current file name and only works if the release group is on the list of known release groups.


:?: If your file names already follow a specific naming pattern such as name [group].mkv then you'll want to just match that information from the file name, and not use the {group} binding:

Code: Select all

{ fn.match(/\[[^\]]+\]$/) }
\[[^\]]+\]$ ... regex pattern matches [...] at the end of the file name



As for the additional off-topic questions:
* {subt} is the subtitle language and is always undefined for non-subtitle files
* {hdr} is the high-dynamic resolution tag and is always undefined for non-HDR files
* {country} is always undefined if the database at hand doesn't keep that piece of information (i.e. TheTVDB APIv2 does not make that information available)
* querying multiple database is possible, but may or may not work well depending on the specific series at hand, mapping direction and available mapping information (if you need dedicated help on this topic, please create a new dedicated thread, describe your use case in detail, and provide sample episode files name testing)



EDIT:

mercator has been added to the list and will start working in 1-2 weeks: viewtopic.php?p=59284#p59284
:idea: Please read the FAQ and How to Request Help.
Post Reply