request: make unixfs configurable

All your suggestions, requests and ideas for future development
Post Reply
jbr439
Posts: 5
Joined: 13 Aug 2012, 23:04

request: make unixfs configurable

Post by jbr439 »

Hello

The linux filebot script has unixfs hardcoded to false: "java -Dunixfs=false ..."

It would be useful if the value was configurable, either via an option or an environment variable.
E.g., "java -Dunixfs=${FILEBOT_UNIXFS:-false} ..."

Please consider this.
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: request: make unixfs configurable

Post by rednoah »

Well if you have to set an ENV variable you might as well just edit filebot.sh

Not gonna add it as cmdline option since it's useless on Windows and even if you have a Linux seedbox there'll still be a Windows machine somewhere. That's also why it's set to false by default.

Btw that ${VAR:-default} is bash syntax? Never seen that. If you send me the full cmdline I can update it like that for next release.
:idea: Please read the FAQ and How to Request Help.
jbr439
Posts: 5
Joined: 13 Aug 2012, 23:04

Re: request: make unixfs configurable

Post by jbr439 »

OK, this is what my filebot.sh now looks like:

Code: Select all

#!/bin/bash

# Comment out following case statement to disable automatic setting of 'unixfs'
case $(uname -s) in
Linux|Darwin|SunOS|AIX|FreeBSD)
        FILEBOT_UNIXFS=true
        ;;
*)
        FILEBOT_UNIXFS=false
        ;;
esac

java -Dunixfs=${FILEBOT_UNIXFS:-false} -Xmx256m -Dapplication.deployment=deb -Dapplication.dir=$HOME/.filebot -Djava.io.tmpdir=$HOME/.filebot/temp -Djna.library.path=/usr/share/filebot -Djava.library.path=/usr/share/filebot -Dsun.net.client.defaultConnectTimeout=5000 -Dsun.net.client.defaultReadTimeout=25000 -jar /usr/share/filebot/FileBot.jar "$@"

Note that I don't have access to OS X (Darwin), SunOS, AIX, or FreeBSD, so I can't test this on those systems (I got the values from the man page of uname). This does work on Linux.
If you don't like the automatic setting of FILEBOT_UNIXFS, then just remove the comment and case statement.

To answer your question: ${VAR:-default} is indeed bash syntax.

Finally, I disagree that custom editing of filebot.sh is a reasonable option, because it creates a maintenance issue. If all I have to do is set an env variable, I do this once in the appropriate manner and I'm done. However, if I have to edit the shell script, then every time I update filebot, I have to remember to go and put back in my custom changes. If I make a local copy of filebot.sh and edit and use that, then I still have to check after every update that nothing has changed; otherwise I need to recopy filebot.sh and reapply my custom changes. That's why I'm hoping to see a supported way to be able to set unixfs to true.

Thanks for taking this into consideration.
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: request: make unixfs configurable

Post by rednoah »

Well, I don't want to enable it by default. If wanted to do that I could just hardcode it to true for the debs. But I don't mind letting you override the default with an environment variable. Gonna add that.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: request: make unixfs configurable

Post by rednoah »

On second though, I'll just add that as normal cmdline option -unixfs. Wouldn't wanna have to start documenting magic environment variables.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: request: make unixfs configurable

Post by rednoah »

Added -unixfs flag with r1209.
:idea: Please read the FAQ and How to Request Help.
jbr439
Posts: 5
Joined: 13 Aug 2012, 23:04

Re: request: make unixfs configurable

Post by jbr439 »

That works for me. Thanks!
Post Reply