Adding release groups to default list dynamically

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
devster
Posts: 417
Joined: 06 Jun 2017, 22:56

Adding release groups to default list dynamically

Post by devster »

Is it possible to selectively add custom lines to the list of release groups that FileBot uses?
Current solutions include
a binding as follows

Code: Select all

    { def grp = fn.match(/(?:(?<=[-])\w+$)|(?:^\w+(?=[-]))/)
      any{"-$group"}{"-$grp"} }
overriding url.release-groups (doable?)

Using .add() with net.filebot.media.ReleaseInfo.releaseGroup doesn't work as the latter is currently private.

Use case is for the rare instances for which a group isn't a proper release group to be added to the official file, and to have changes immediately available.
I only work in black and sometimes very, very dark grey. (Batman)
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Adding release groups to default list dynamically

Post by rednoah »

UPDATE: DEPRECATED. DOES NOT WORK WITH NEWER VERSIONS.


You can pass in your own URL via Java System Properties:

Code: Select all

-Durl.release-groups=file://<path>
:idea: The system property takes precedence over the properties file property. It's what I use for debugging.

:idea: That means you'll have to manage and merge your own group list though. There's no way to "add" custom extra groups.
:idea: Please read the FAQ and How to Request Help.
devster
Posts: 417
Joined: 06 Jun 2017, 22:56

Re: Adding release groups to default list dynamically

Post by devster »

Thank you for confirming.
As I mentioned it's more for ad-hoc processing rather than a stable solution.
I'll keep adding new groups to the thread in case I find them.
I only work in black and sometimes very, very dark grey. (Batman)
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Adding release groups to default list dynamically

Post by rednoah »

In that case, the best solution is probably something like this:

Code: Select all

f.path.match(readLines("my-groups.txt").join("|"))
i.e. generate the pattern from your own text file
:idea: Please read the FAQ and How to Request Help.
devster
Posts: 417
Joined: 06 Jun 2017, 22:56

Re: Adding release groups to default list dynamically

Post by devster »

The reason I wanted to use the option vs a format was the way the group binding is generated.
I'm not much of a coder, but it seems much more sophisticated, for example it removes already matched patterns.
I'll try both options, see which ones works best.
I only work in black and sometimes very, very dark grey. (Batman)
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Adding release groups to default list dynamically

Post by rednoah »

That is true. There's more to it than that. Such as trying to not accidentally match the group from the series name or episode title.

Though for your specific case you can probably just assume that the group is either the last word or the first word of the filename.
:idea: Please read the FAQ and How to Request Help.
devster
Posts: 417
Joined: 06 Jun 2017, 22:56

Re: Adding release groups to default list dynamically

Post by devster »

For posterity, a couple of gotchas
file:// is the protocol, so path may require an additional slash

Code: Select all

-Durl.release-groups=file://<path>
-Durl.release-groups=file:///mnt/mymount
the supplied file needs to be xz-compressed

Code: Select all

xz -z file.txt
should replace the file without needing other steps.
I only work in black and sometimes very, very dark grey. (Batman)
andy22
Posts: 10
Joined: 17 Aug 2020, 16:59

Re: Adding release groups to default list dynamically

Post by andy22 »

devster wrote: 22 Apr 2019, 16:18 For posterity, a couple of gotchas
file:// is the protocol, so path may require an additional slash

Code: Select all

-Durl.release-groups=file://<path>
-Durl.release-groups=file:///mnt/mymount
the supplied file needs to be xz-compressed

Code: Select all

xz -z file.txt
should replace the file without needing other steps.
I can't get this to work, is this still working?
I use the portable version and just added this to the filebot.l4j.ini file.

Code: Select all

-Durl.release-groups=file://"%EXEDIR%\release-groups.txt.xz"
From my understanding this should than pickup the file from the filebot portable directory, where the filebot.l4j.ini is also located?
Yet trying to get the new groups via {group} format always fails?

PS: This is on windows and i also tried without the xz compression.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Adding release groups to default list dynamically

Post by rednoah »

I'm fairly sure that these System Properties no longer work since the rewrite some time 1-2 years ago.


If you want to match groups yourself, then it is recommended that you write the complete code (read text file, check each pattern, just a few lines) yourself so that you have full understanding and thus full control over matching, prioritization, pre-processing steps, etc.

e.g.

Code: Select all

def groups = lines('/path/to/groups.txt')
groups.find{ fn =~ it }
:idea: Please read the FAQ and How to Request Help.
Post Reply