Sort movies by year range (e.g. 1900-1999)
-
- Posts: 9
- Joined: 18 Feb 2017, 19:06
Sort movies by year range (e.g. 1900-1999)
Hi,
I have been using a rather unusal folder structure for my movies.
Which is like this
/Movies/1900 - 1999
/2000 - 2010
/2011
/2012
And so forth..
So, the AMC script are actually working fine for newer movies. But Filebot creates new folders for older movies like 1995(Which make sense, as my script indicates it should do that, i am aware)
But is there any expression i could use to format that to fit my actual needs? I cant seem to figure out how to say movies from 19xx ->(go to) that exact folder.
Have a great weekend
I have been using a rather unusal folder structure for my movies.
Which is like this
/Movies/1900 - 1999
/2000 - 2010
/2011
/2012
And so forth..
So, the AMC script are actually working fine for newer movies. But Filebot creates new folders for older movies like 1995(Which make sense, as my script indicates it should do that, i am aware)
But is there any expression i could use to format that to fit my actual needs? I cant seem to figure out how to say movies from 19xx ->(go to) that exact folder.
Have a great weekend
Re: Sort movies by my broken organization
That's a cute use case. A simple if-then-else will get job done:
Code: Select all
{y > 2010 ? y : y > 1999 ? '2000-2010' : '1900-1999'}
Please read the FAQ and How to Request Help.
-
- Posts: 9
- Joined: 18 Feb 2017, 19:06
Re: Sort movies by year range (e.g. 1900-1999)
I completely forgot about this.
You are a wizard for us "noobs".
It worked flawlessly, in first try.
Thank you once again!!
You are a wizard for us "noobs".
It worked flawlessly, in first try.
Thank you once again!!
-
- Posts: 9
- Joined: 18 Feb 2017, 19:06
Re: Sort movies by year range (e.g. 1900-1999)
While i am at it.. Im trying to cut from 2 scripts to 1..
Is it possible to make filebot try to match a collection
Like this;
But if no match for collection is found then use
Cant seem to figure out if that is possible. Right now i am using two scripts to seperate..
Is it possible to make filebot try to match a collection
Like this;
Code: Select all
{any{'Movie Collections/'+collection}{'Movie'}}/{ny})
Code: Select all
{y > 2010 ? y : y > 1999 ? '2000 - 2010' : '19xx - 1999'}/{ny}/{ny}
Re: Sort movies by year range (e.g. 1900-1999)
Sure:
Code: Select all
any{"Movie Collections/$collection"}{"${y > 2010 ? y : y > 1999 ? '2000 - 2010' : '19xx - 1999'}/Movies"}
Please read the FAQ and How to Request Help.
-
- Posts: 9
- Joined: 18 Feb 2017, 19:06
Re: Sort movies by year range (e.g. 1900-1999)
Thank you for the reply.
Unfortunately i am not that great with expression, format and anything in between, BUT!
I got it to work with some modifications, this is how it looks(Used the -action test)
Thank you once again!
Unfortunately i am not that great with expression, format and anything in between, BUT!
I got it to work with some modifications, this is how it looks(Used the -action test)
Code: Select all
"/volume1/Media/Test/{any{'Collections/'+collection}{y > 2010 ? y : y > 1999 ? '2000 - 2010' : '19xx - 1999'}}/{ny} {vc}-{vf} {source}{'.'+lang}"
Re: Sort movies by year range (e.g. 1900-1999)
I was using "..." in the format, so on the command-line you'd have to escape that correctly because "..." already has special meaning.
Use the @file syntax for reading command-line arguments from external text files so you don't have to worry about command-line argument parsing.
Use the @file syntax for reading command-line arguments from external text files so you don't have to worry about command-line argument parsing.
Please read the FAQ and How to Request Help.
-
- Posts: 107
- Joined: 12 Apr 2020, 04:02
Re: Sort movies by year range (e.g. 1900-1999)
Code: Select all
{
y > 2019 ? '2020'
: y > 2014
? '2015-2019'
: y > 2009
? '2010-2014'
: y > 2004
? '2005-2009'
: y > 1999
? '2000-2004'
: y > 1989
? '1990-1999'
: y > 1979
? '1980-1989'
: y > 1969
? '1970-1979'
: y > 1959
? '1960-1969'
: y > 1949
? '1950-1959'
: '1900-1949'
}
Re: Sort movies by year range (e.g. 1900-1999)
why not use Switch Statement ?
https://www.tutorialspoint.com/groovy/g ... tement.htm
https://groovy-lang.org/semantics.html
e.g.
https://www.tutorialspoint.com/groovy/g ... tement.htm
https://groovy-lang.org/semantics.html
e.g.
Code: Select all
{
switch (y) {
case {y > 2019}:
return '2020'
case {y > 2014}:
return '2015-2019'
case {y > 2009}:
return '2010-2014'
default:
return 'bad year'
}
}