Page 1 of 1

Adding release groups to default list dynamically

Posted: 13 Apr 2019, 23:02
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.

Re: Adding release groups to default list dynamically

Posted: 14 Apr 2019, 04:06
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.

Re: Adding release groups to default list dynamically

Posted: 14 Apr 2019, 07:48
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.

Re: Adding release groups to default list dynamically

Posted: 14 Apr 2019, 08:12
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

Re: Adding release groups to default list dynamically

Posted: 14 Apr 2019, 13:18
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.

Re: Adding release groups to default list dynamically

Posted: 14 Apr 2019, 13:24
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.

Re: Adding release groups to default list dynamically

Posted: 22 Apr 2019, 16:18
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.

Re: Adding release groups to default list dynamically

Posted: 17 Aug 2020, 23:39
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.

Re: Adding release groups to default list dynamically

Posted: 18 Aug 2020, 04:29
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 }