Adding release groups to default list dynamically

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

Adding release groups to default list dynamically

Post by devster » 13 Apr 2019, 23:02

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: 16123
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Adding release groups to default list dynamically

Post by rednoah » 14 Apr 2019, 04:06

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: 284
Joined: 06 Jun 2017, 22:56

Re: Adding release groups to default list dynamically

Post by devster » 14 Apr 2019, 07:48

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: 16123
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Adding release groups to default list dynamically

Post by rednoah » 14 Apr 2019, 08:12

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: 284
Joined: 06 Jun 2017, 22:56

Re: Adding release groups to default list dynamically

Post by devster » 14 Apr 2019, 13:18

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: 16123
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Adding release groups to default list dynamically

Post by rednoah » 14 Apr 2019, 13:24

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: 284
Joined: 06 Jun 2017, 22:56

Re: Adding release groups to default list dynamically

Post by devster » 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 only work in black and sometimes very, very dark grey. (Batman)

Post Reply