Docker - Filebot:watcher - Organize by TVDB/TMDB genres

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
Wirly
Posts: 9
Joined: 10 Aug 2020, 01:08

Docker - Filebot:watcher - Organize by TVDB/TMDB genres

Post by Wirly »

Hello, I've been using FileBot manually for the last 5 years and have loved it. I recently learned about dockers and am using it to create a new media setup. After noticing a FileBot container, I was wanting to utilize it for monitoring a folder and then copying and renaming files according to TVDB/TMDB.

However, I'm having trouble figuring out how to check if a show/movie has a particular genre and then directing it to a specific folder if it does.

I organize my Movies and TV Shows into 3 categories; Animation, Anime, Live-action. My tree looks like this (ignore the blurs)...

Image

Basically, I would like FileBot to check if a series contains certain TVDB genre(s) and then output to a specific folder depending on true/false. For TMDB movies, if the movie contains a particular keyword it will be outputted to a specific folder.

In code it would look like this...

Code: Select all

genres = [TVDB GENRES...]

if ('animation' and 'anime') in genres:
	type = 'Anime'
elif 'animation' in genres:
	type = 'Animated'
else:
	type = 'Live-Action'
	
output_folder = f"Movies/{type}"
For example, if you look at the Ponyo entry on TMDB, you'll notice that it contains the keywords [animation, anime]. Therefore it should be moved to the 'Movies/Anime' folder. If it only had the 'animation' keyword, then it belongs in the 'Movies/Animated' folder. Otherwise, it should default to the 'Movies/Live-Action' folder.

TVDB has genre tags instead of keywords like TMDB, so I'd do essentially the same thing.

I know I'll have to use the --filters option to make this work, I just can't seem to find the documentation on it that I need. I'm also wondering if my input folder will work, because it contains several sub-folders, one for each tracker I'm downloading from.

Here's what I have so far in my docker-compose. I haven't actually tested anything yet because I know my --filter options won't work (I just made them up as placeholders/examples).

Code: Select all

    # - ===== FileBot =====
    filebot_service:
        image: rednoah/filebot:watcher
        container_name: filebot_container
        restart: unless-stopped
        command: /media/BitTorrent/Complete --action copy --conflict skip --filter "[animation, anime] in genres" --def "VIDEO_GENRE=Anime" --filter "animation in genres" --def "VIDEO_GENRE=Animation" --filter "[animation, anime] not in genres" --def "VIDEO_GENRE=Live-Action" --output "/media/Ashley/Media" --def movieFormat="Movies/$VIDEO_GENRE/{collection+'/'}{n.colon(' - ')} ({y}){' CD'+pi}{subt}" seriesFormat="Series/$VIDEO_GENRE/{ny}/{'Season ' + {s.pad(2)}}/{s00e00} - {t}"
        volumes:
          - /Q/Media/:/media/Ashley/Media/
          - /S/BitTorrent/Complete/:/media/BitTorrent/Complete/
          - ./filebot/data/:/data
Any tips on how to get this working with a single container? If I have to call external scripts that's fine, but I'm wondering if amc can handle it stand-alone.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Docker - Filebot:watcher - Organize by TVDB/TMDB genres

Post by rednoah »

You'll have to customize your format and then generate different file paths for depending on your conditions:

Code: Select all

'Animation' in genres ? 'Anime' in info.keywords ? 'Anime' : 'Animated' : 'Live-Action'
e.g.

Code: Select all

Movies/{'Animation' in genres ? 'anime' in info.keywords ? 'Anime' : 'Animated' : 'Live-Action'}/{plex.tail}
:idea: Please read the FAQ and How to Request Help.
Wirly
Posts: 9
Joined: 10 Aug 2020, 01:08

Re: Docker - Filebot:watcher - Organize by TVDB/TMDB genres

Post by Wirly »

Looks like I was looking in the wrong spot and making things more difficult than necessary. Got it working just how I wanted, easy-peasy. Thanks a bunch noah!
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Docker - Filebot:watcher - Organize by TVDB/TMDB genres

Post by rednoah »

If you're looking to simplify things, and only care about Anime / not-Anime, then the built-in {anime} binding will help with that.

e.g.

Code: Select all

anime ? 'Anime Movie' : 'Normal Movie'
:idea: Please read the FAQ and How to Request Help.
Post Reply