Page 1 of 1

Filebot-watcher / docker / compose

Posted: 10 Oct 2023, 16:56
by MeBot
Hi,

Ok, so I have spent too long trying to get the filebot:watcher docker container working. I am using docker compose. At first the watcher just refused to trigger, and I was changing/adding/removing options trying to get it to start. After a while I discovered that it only works when a different docker container places the file in the directory and not when I move/copy files manually nor even via python script running on the host. Odd, but this is OK since the other container will be placing the files anyway. Now however, I should note I am working with .strm files, when the watcher see's the file I get this:

[INOTIFY] <filename>.strm
Waiting 300 seconds for changes to settle down...
Ignore: <filename>.strm: text/plain

Why is the file ignored? What command do I need to allow text/plain?

This is my command list from the docker-compose.yml:

Properties: Select all

command:
      - /mnt/new_dir
      - --output
      - /mnt/output_dir
      - --log-file
      - /mnt/log_dir/movies.log
      - --action
      - COPY
      - --conflict
      - SKIP
      - --def
      - storeReport=/mnt/log_dir/store_report
      - artwork=y
      - minFileSize=0
      - minLengthMS=0
      - unsorted=y
      - skipExtract=y
      - excludeList=/mnt/log_dir/movies.exclude
      - movieFormat={emby.id}
      - movieDB=TheMovieDB
      - emby=*****
      - "ut_label=Movie"
Any help would be appreciated. Cheers

Re: Filebot-watcher / docker / compose

Posted: 10 Oct 2023, 17:24
by rednoah
Unfortunately, at a glance, there seems to be no way to get around the file --mime-type check in the filebot-watcher script, unless you modify the script.


:arrow: You could modify filebot-watcher script and build your own container with your own filebot-watcher script:

Shell: Select all

if file --mime-type "$FILE" | egrep --quiet "directory|video|audio|empty|octet-stream"; then
	filebot -script fn:amc --action duplicate --conflict auto -non-strict --log-file amc.log --def excludeList=".excludes" unsorted=y music=y artwork=y "$@"
else
	echo "Ignore: $(file --mime-type "$FILE")"
fi

:arrow: Alternatively, you can just not use docker and install filebot and inotifywait on the host instead. That would make things easier if you're using a standard Linux system. See How do I monitor a folder and call filebot on newly added files? for details.

Re: Filebot-watcher / docker / compose

Posted: 10 Oct 2023, 17:30
by MeBot
OK thanks. I was already considering a custom container, will give that a try. Failing that, will bite the bullet and install on host.

Cheers

Re: Filebot-watcher / docker / compose

Posted: 10 Oct 2023, 17:32
by rednoah
Occasionally adding a *.mkv file to the input folder would also trigger the amc script call, which would then process all the unprocessed *.strm files as well.

Re: Filebot-watcher / docker / compose

Posted: 10 Oct 2023, 17:58
by MeBot
I did try that, but it was an empty file. Maybe it has something to do with the file size?

Also, can I drop the settle down time (SETTLE_DOWN_TIME), or is it frowned upon? Is it for rate limiting? Or only to give files time to write?

Re: Filebot-watcher / docker / compose

Posted: 10 Oct 2023, 18:46
by rednoah
MeBot wrote: 10 Oct 2023, 17:58 I did try that, but it was an empty file. Maybe it has something to do with the file size?
:?: What does the console output say? Note the difference between filebot-watcher not calling the amc script at all, and the amc script being called but not doing anything with the given input files for some reason.


:idea: empty files work too because:

Shell: Select all

egrep --quiet "directory|video|audio|empty|octet-stream"

:idea: SETTLE_DOWN_TIME is indeed only there to monitor the file system for additional changes after the first change event, i.e. try to not process incomplete files.


:idea: filebot-watcher is kept simple (~20 lines) so that you can read the code and understand what it does, and make modifications if necessary.

Re: Filebot-watcher / docker / compose

Posted: 10 Oct 2023, 20:11
by MeBot
Excellent thank you. I am on something else at the moment, but I should be able to get it working thanks to your assistance. Much appreciated.