Sorting Documentaries (Movies and TV Shows) Into It's Own Folder

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
tolagarf
Posts: 18
Joined: 20 Sep 2017, 08:02

Sorting Documentaries (Movies and TV Shows) Into It's Own Folder

Post by tolagarf »

Hey there.

Been running Filebot for a few months and been working splendid so far, but I realise what I want to do is rather complicated since I don't understand much of this scripting anyway.

Right now all my documentaries are dropped in with both movies and TV shows since some of them are classified as a movie instead of episodes, and I'd like Filebot to move all documentaries into it's own folder. Problem is my directory listing under TV shows is becoming rather long, and I'd rather have them all copied in under "Docus" instead of either "Movies" or "TV Shows"

I've been using this script with great success, and I was hoping someone could help me change it so it suits my needs:

filebot.exe -script fn:amc --output "D:/Downloads" --action copy --conflict skip -non-strict "C:/!torrent" --log-file "D:/Downloads/amc.log" --def excludeList=amc.txt --def movieFormat="E:/Movies/{ny}/{fn}" seriesFormat="D:/TV Shows/{n}/Season {s}/{n}.{S00E00}.{source}.{vf}.{vc}.{ac}{'-'+group}" animeFormat="D:/TV Shows/{n}/Season {s}/{n}.{S00E00}.{source}.{vf}.{vc}.{ac}{'-'+group}" musicFormat="D:/Musik/{n}/{fn}" unsorted=y music=y extractFolder="D:/Downloads/Unsorted" artwork=y deleteAfterExtract=y clean=y reportError=y gmail=xxxxx:xxxxx --filter "age < 7 || !model.any{ it.age < 7 }"
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Sorting Documentaries (Movies and TV Shows) Into It's Own Folder

Post by rednoah »

You could use custom format expression that yield different destination paths for different episode or movie objects.

How you decide what episode/movie should be considered a "documentary" is up to your custom format. I'd probably just check if {genres} contains Documentary.
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Sorting Documentaries (Movies and TV Shows) Into It's Own Folder

Post by kim »

the 1st problem is you dont' know if AMC (filebot) will detect it as a series (aka thetvdb) or movie (aka themoviedb)
... you need to change both "movieFormat" and "seriesFormat" to do this.

or you can force is to detect it as a series (aka thetvdb) or movie (aka themoviedb)
from amc script:

Code: Select all

def forceMovie(f) {
	label =~ /^(?i:Movie|Film|Concert|UFC)/ || f.dir.listPath().any{ it.name ==~ /(?i:Movies|Movie)/ } || f.isMovie() || any{ f.isVideo() && !forceSeries(f) && getMediaInfo(f, '{minutes}').toInteger() >= 100 }{ false }
}

def forceSeries(f) {
	label =~ /^(?i:TV|Show|Series|Documentary)/ || f.dir.listPath().any{ it.name ==~ /(?i:TV.Shows|TV.Series|TV)/ } || f.path =~ /(?<=\b|_)(?i:tv[sp]-|Season\D?\d{1,2}|\d{4}.S\d{2})(?=\b|_)/ || parseEpisodeNumber(f.path, true) || parseDate(f.path)
}
genre check for "Documentary" under movieFormat

Code: Select all

{
if (genres.contains(/Documentary/)){'E:/Docus/'+{ny}+'/'+{fn}}
else {'E:/Movies/'+{ny}+'/'+{fn}}
}
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Sorting Documentaries (Movies and TV Shows) Into It's Own Folder

Post by rednoah »

If you know that it's a documentary in advance, then it's probably best to use --def ut_label=TV to force TV mode, so all the documentary episodes get matched with TheTVDB episode data and move/copied according to the custom series format.
:idea: Please read the FAQ and How to Request Help.
tolagarf
Posts: 18
Joined: 20 Sep 2017, 08:02

Re: Sorting Documentaries (Movies and TV Shows) Into It's Own Folder

Post by tolagarf »

kim wrote: 21 Sep 2017, 00:04 the 1st problem is you dont' know if AMC (filebot) will detect it as a series (aka thetvdb) or movie (aka themoviedb)
... you need to change both "movieFormat" and "seriesFormat" to do this.

or you can force is to detect it as a series (aka thetvdb) or movie (aka themoviedb)
from amc script:

Code: Select all

def forceMovie(f) {
	label =~ /^(?i:Movie|Film|Concert|UFC)/ || f.dir.listPath().any{ it.name ==~ /(?i:Movies|Movie)/ } || f.isMovie() || any{ f.isVideo() && !forceSeries(f) && getMediaInfo(f, '{minutes}').toInteger() >= 100 }{ false }
}

def forceSeries(f) {
	label =~ /^(?i:TV|Show|Series|Documentary)/ || f.dir.listPath().any{ it.name ==~ /(?i:TV.Shows|TV.Series|TV)/ } || f.path =~ /(?<=\b|_)(?i:tv[sp]-|Season\D?\d{1,2}|\d{4}.S\d{2})(?=\b|_)/ || parseEpisodeNumber(f.path, true) || parseDate(f.path)
}
genre check for "Documentary" under movieFormat

Code: Select all

{
if (genres.contains(/Documentary/)){'E:/Docus/'+{ny}+'/'+{fn}}
else {'E:/Movies/'+{ny}+'/'+{fn}}
}
Thank you for putting so much effort into this, but I really don't know where to start with this. Seems a bit complicated for me right now, perhaps I will look into it later on.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Sorting Documentaries (Movies and TV Shows) Into It's Own Folder

Post by kim »

well try putting all the Documentary's in folder named:
1. TV Shows OR TV Series OR TV = detect it as a series (force use thetvdb)
2. Movies OR Movie = detect it as a movie (force use themoviedb)

then update your stuff like so (I HAVE NOT TESTED THIS)

Code: Select all

filebot.exe -script fn:amc --output "D:/Downloads" --action copy --conflict skip -non-strict "C:/!torrent" --log-file "D:/Downloads/amc.log" --def excludeList=amc.txt --def movieFormat="{genres.contains(/Documentary/) ? 'E:/Docus/' : 'E:/Movies/'}{ny}/{fn}" seriesFormat="{genres.contains(/Documentary/) ? 'E:/Docus/' : 'D:/TV Shows/'}{n}/Season {s}/{n}{'.'+S00E00}{'.'+source}{'.'+vf}{'.'+vc}{'.'+ac}{'-'+group}" animeFormat="D:/TV Shows/{n}/Season {s}/{n}.{S00E00}.{source}.{vf}.{vc}.{ac}{'-'+group}" musicFormat="D:/Musik/{n}/{fn}" unsorted=y music=y extractFolder="D:/Downloads/Unsorted" artwork=y deleteAfterExtract=y clean=y reportError=y gmail=xxxxx:xxxxx --filter "age < 7 || !model.any{ it.age < 7 }"
tolagarf
Posts: 18
Joined: 20 Sep 2017, 08:02

Re: Sorting Documentaries (Movies and TV Shows) Into It's Own Folder

Post by tolagarf »

Once again, thank you Kim for your suggestion. That actually seems to work! Haven't done extensive testing, but I guess I will over the next few weeks.

This is how my scrips looks like now:

Code: Select all

filebot.exe -script fn:amc --output "F:/Downloads" --action copy --conflict skip -non-strict "F:/!torrent" --log-file "F:/Downloads/amc.log" --def excludeList=amc.txt --def movieFormat="{genres.contains(/Documentary/) ? 'D:/Docus/' : 'E:/Movies/'}/{plex.name}/{plex.name}{'.'+vf}{'.'+vc}{'.'+ac}{'-'+group}" seriesFormat="{genres.contains(/Documentary/) ? 'D:/Docus/' : 'D:/TV Shows/'}{plex.tail}{'.'+source}{'.'+vf}{'.'+vc}{'.'+ac}{'-'+group}" animeFormat="D:/TV Shows/'}{plex.tail}{'.'+source}{'.'+vf}{'.'+vc}{'.'+ac}{'-'+group}" musicFormat="D:/Musik/{n}/{fn}" unsorted=y music=y extractFolder="F:/Downloads/Unsorted" artwork=y deleteAfterExtract=y clean=y reportError=y gmail=xxxxx:xxxxx --filter "age < 7 || !model.any{ it.age < 7 }"
Post Reply