Page 1 of 1

Help modifying filebot.sh script to organize movies by new releases

Posted: 24 Feb 2019, 20:00
by pimogo
I'm using the filebot.sh file to call the AMC script to organize my movies. Presently all movies are placed in the parent folder /Movies.

e.g. /Movies/Movie Title (2019)

I'd like to add an additional step that first determines the year of the movie's release, then adds them to the following if the movie was released in the present year. Like so:

e.g. /Movies/Movies-New Releases/Movie Title (2019)

Otherwise, if the movie falls in any other release year, it places it in the default folder /movies/movies-archive.

I've taken a look at the filebot.sh file and it seems to me the line item that needs to change is the following:

Code: Select all

# Movies/Fight Club.mkv
MOVIE_FORMAT="Movies/{ny}/{n.$QUOTE_FIXER} ({y}) {' CD'+pi}"
However, i dont know what would be the most efficient way to execute an if/else statement that determines year of movie and then places them correctly in the appropriate subfolder: Movies-New Releases or Movies-Archive.

What would you suggest?

Thanks!

Re: Help modifying filebot.sh script to organize movies by new releases

Posted: 25 Feb 2019, 02:55
by rednoah
Here's a few if-then-else examples:
viewtopic.php?f=5&t=4191


You could check {y} like so:

Code: Select all

y == 2019 ? /New Movie/ : /Old Movie/

However, but you probably wanna use {age} to check if a movie was released within the last N days:

Code: Select all

age < 360 ? /New Movie/ : /Old Movie/

Re: Help modifying filebot.sh script to organize movies by new releases

Posted: 25 Feb 2019, 18:57
by pimogo
Thanks! This is brilliant--will try these. Also whats the best way to consolidate these statements? Like this?

Code: Select all

MOVIE_FORMAT="age < 360 ? /New Movie/ : /Old Movie/{ny}/{n.$QUOTE_FIXER} ({y}) {' CD'+pi}"

Re: Help modifying filebot.sh script to organize movies by new releases

Posted: 25 Feb 2019, 19:20
by rednoah
No, you never modify filebot.sh (aka /usr/local/bin/filebot) unless you know exactly what you're doing.

However, if you happen to be using that docker container made by that guy who isn't me, then there's a docker entry point filebot.sh script which in turn calls the actual filebot.sh script, among other things, so that one you might have to figure out yourself.

Re: Help modifying filebot.sh script to organize movies by new releases

Posted: 25 Feb 2019, 22:59
by pimogo
Yes you're right this is the coppit docker for Unraid. Do you have a docker I can use instead?

Re: Help modifying filebot.sh script to organize movies by new releases

Posted: 26 Feb 2019, 06:23
by rednoah
The official Docker images are available on Docker Hub:
https://hub.docker.com/r/rednoah/filebot/

But it's not exactly the same. These images are made for Docker, and not specifically for Unraid Docker, and thus don't have Unraid-specific UI integration.