2 bugs / feature requests on script interface

All your suggestions, requests and ideas for future development
Post Reply
valerio
Posts: 5
Joined: 15 Jul 2012, 12:15

2 bugs / feature requests on script interface

Post by valerio »

Hello,
I recently started to use filebot to automate my htpc running xbmc and I have to say that this project is very well done and it works fairy well. I use the "utorrent-postprocess" script and most of the time it correctly recognizes my movies / TV series.

During my use of filebot though I think I've discovered 2 bugs, and since I like the project and I'm hoping to see them corrected, I'm reporting them :)

The first one caused the following stack trace:

Looking up subtitles by filehash via Sublight
Error: Failed to create temporary file for jnidispatch library: java.io.IOException: Permission denied
java.lang.Error: Failed to create temporary file for jnidispatch library: java.io.IOException: Permission denied
at com.sun.jna.Native.loadNativeLibraryFromJar(Native.java:762)
at com.sun.jna.Native.loadNativeLibrary(Native.java:697)
at com.sun.jna.Native.<clinit>(Native.java:127)
at com.sun.jna.NativeLibrary.<clinit>(NativeLibrary.java:62)
at net.sourceforge.filebot.mediainfo.MediaInfo.<clinit>(Unknown Source)
at net.sourceforge.filebot.web.SublightVideoHasher.getDuration(Unknown Source)
at net.sourceforge.filebot.web.SublightVideoHasher.computeHash(Unknown Source)
at net.sourceforge.filebot.web.SublightSubtitleClient.getSubtitleList(Unknown Source)
at net.sourceforge.filebot.cli.CmdlineOperations.lookupSubtitleByHash(Unknown Source)
at net.sourceforge.filebot.cli.CmdlineOperations.getSubtitles(Unknown Source)
at net.sourceforge.filebot.cli.CmdlineOperations.getMissingSubtitles(Unknown Source)
at net.sourceforge.filebot.format.PrivilegedInvocation$1.run(Unknown Source)
at net.sourceforge.filebot.format.PrivilegedInvocation.invoke(Unknown Source)
at $Proxy5.getMissingSubtitles(Unknown Source)
at Script2$_getMissingSubtitles_closure61.doCall(Script2.groovy:210)
at Script2$_getMissingSubtitles_closure61.doCall(Script2.groovy)
at Script2$_run_closure52.doCall(Script2.groovy:284)
at Script2.getMissingSubtitles(Script2.groovy:210)
at Script3$_run_closure6.doCall(Script3.groovy:50)
at Script3.run(Script3.groovy:48)
at net.sourceforge.filebot.cli.ScriptShell.evaluate(Unknown Source)
at net.sourceforge.filebot.cli.ScriptShell.runScript(Unknown Source)
at net.sourceforge.filebot.cli.ArgumentProcessor.process(Unknown Source)
at net.sourceforge.filebot.Main.main(Unknown Source)

What can I say is that during the lookup of subtitles a temporary file is being created but it fails due to lack of permissions. I ran the script on a Debian box with the /tmp directory world writtable. The problem was that I previously ran the script as root and a /tmp/jna directory was created (owned by root, not world writable). Removing the directory and launching the script again as a normal user, it completed correctly.
This problem does not look to be related with filebot itself but with JNA library. It has been reported here: https://github.com/twall/jna/pull/58 so I suppose that this problem will fix itself by updating the library filebot uses.

As for the second problem I found, I'm not entirely sure it is a bug or a feature request but this board is for both so I suppose it's okay :p
I have found out that sometimes movies that filebot have difficulties on being recognized end up being classified as this movie: http://en.wikipedia.org/wiki/Downloading_Nancy
The problem seems related to the fact that downloaded movies are in this directory: /home/valerio/data/downloads and the methods "public static File guessMovieFolder(File movieFile) throws IOException" and "public static List<String> detectSeriesNames(Collection<File> files, Locale locale) throws Exception" that both look for parent directories to detect the name of the movie / TV series. In both cases the number of parent directories to examine is hard wired inside code (2 and 3 respectively).
What I would propose is to make the number of parent folder to inspect configurable in some way so that it is possible to tell filebot whenever he should stop because he's actually running into folders that have no relation with the downloaded media.

Let me know what you think about those two and kudos for the project :)
User avatar
rednoah
The Source
Posts: 22984
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: 2 bugs / feature requests on script interface

Post by rednoah »

1. You can also fix this by adding -Djava.io.tmpdir=~/.filebot/temp to filebot.sh. Try that, if it works well I'll add it to the linux startup scripts.

2. It can't really know if folder or file is meaningful, as long as one of the two is good, it'll converge on that. Configuring that depth wouldn't make sense and most people wouldn't get it anyway. But don't worry, I'm way ahead of you ;)

Here's what FileBot knows to be "not a movie/series":
http://filebot.sourceforge.net/data/query-blacklist.txt

Added /download[s]?/ and it'll auto-update into your app within 24h and fix any "Downloading Nancy" problems.
:idea: Please read the FAQ and How to Request Help.
valerio
Posts: 5
Joined: 15 Jul 2012, 12:15

Re: 2 bugs / feature requests on script interface

Post by valerio »

1. does not completely work: the script completed without issues but the definition added created a directory ~/.filebot/temp in the current working directory (i.e. /home/valerio/~/.filebot/). using -Djava.io.tmpdir=$HOME/.filebot/temp works correctly though (i.e. creates a temp directory inside /home/valerio/.filebot/)

2. I didn't know about this feature. Basically filebot remotely read that blacklist file every time he does a query? Is it cached somewhere? Also this will not prevent the poor Downloading Nancy from being recognized at all? :p

Thank you very much for the help anyway
User avatar
rednoah
The Source
Posts: 22984
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: 2 bugs / feature requests on script interface

Post by rednoah »

1. Updated the linux startup scripts to save temp files to the application folder rather than the temp dir => http://filebot.svn.sourceforge.net/view ... ision=1090

Code: Select all

java -Dunixfs=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 -jar /usr/share/filebot/FileBot.jar "$@"
2. Of course it's cached, but it'll check for updates every day and grab the new data if necessary. Actually I added ^download[s]?$, so only folders exactly named "Download" or "Downloads" will be blacklisted.
:idea: Please read the FAQ and How to Request Help.
valerio
Posts: 5
Joined: 15 Jul 2012, 12:15

Re: 2 bugs / feature requests on script interface

Post by valerio »

Hello,
just a quick question regarding (2). Is it possible to customize or extend the blacklist file? Or to point filebot toward a local blacklist file?

Thank you!
User avatar
rednoah
The Source
Posts: 22984
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: 2 bugs / feature requests on script interface

Post by rednoah »

You can tell me what to add to the backlist and I'll update it for everybody.
:idea: Please read the FAQ and How to Request Help.
Post Reply