filter timespamp doesn't work with 4.7.5

All your suggestions, requests and ideas for future development
Post Reply
warover
Posts: 17
Joined: 26 Mar 2013, 13:52

filter timespamp doesn't work with 4.7.5

Post by warover »

following filter doesn't work anymore:
--filter "d.timeStamp > now.time || age < 8"
please advice
thx in advance
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: filter timespamp doesn't work with 4.7.5

Post by rednoah »

"age < 8" will work perfectly fine, since age will throw an error if negative instead of returning a negative value.
:idea: Please read the FAQ and How to Request Help.
warover
Posts: 17
Joined: 26 Mar 2013, 13:52

Re: filter timespamp doesn't work with 4.7.5

Post by warover »

ok thx just "age < 8" works but are future episodes covered then
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: filter timespamp doesn't work with 4.7.5

Post by rednoah »

Yes, in that future episodes fail to pass the filter (same as in your original expression).
:idea: Please read the FAQ and How to Request Help.
warover
Posts: 17
Joined: 26 Mar 2013, 13:52

Re: filter timespamp doesn't work with 4.7.5

Post by warover »

ok i see is there a filter expression to filter results for airdate older than 8 days AND/OR future episodes?
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: filter timespamp doesn't work with 4.7.5

Post by rednoah »

Sure:

Code: Select all

any{ age > 8 }{ true }
But I'm not sure if that makes any sense as --filter expression for -rename calls...
:idea: Please read the FAQ and How to Request Help.
nuchdog
Posts: 4
Joined: 25 Dec 2016, 22:26

Re: filter timespamp doesn't work with 4.7.5

Post by nuchdog »

Is there a way to limit the time frame for future episodes? any{ age < 5}{true} returns all future episodes. With timeStamp I could filter down to only episodes in the next few days.

Specifically, some episodes hit my machine before midnight in my timezone and thus show as technically not having aired yet since the timezone they aired in is ahead of me. Using just an {age < 5} filter will match the previous episode or match nothing at all since 5 is too small. If I coupled that with a filter based on "d.timeStamp", I was able to filter down to episodes that aired in the past few days or episodes that would air in the next day or two. This allowed the new episode to be matched correctly even though it "hadn't aired yet" due to my timezone offset. When I updated, this filter doesn't seem to work anymore.

I have been trying various things {airdate.timeStamp < (now.time + 2*24*60*60*1000)} but nothing has worked. Any help or insight would be greatly appreciated.
ZeroByDivide
Posts: 170
Joined: 16 Dec 2014, 01:39

Re: filter timespamp doesn't work with 4.7.5

Post by ZeroByDivide »

nuchdog wrote:Is there a way to limit the time frame for future episodes? any{ age < 5}{true} returns all future episodes. With timeStamp I could filter down to only episodes in the next few days.

Specifically, some episodes hit my machine before midnight in my timezone and thus show as technically not having aired yet since the timezone they aired in is ahead of me. Using just an {age < 5} filter will match the previous episode or match nothing at all since 5 is too small. If I coupled that with a filter based on "d.timeStamp", I was able to filter down to episodes that aired in the past few days or episodes that would air in the next day or two. This allowed the new episode to be matched correctly even though it "hadn't aired yet" due to my timezone offset. When I updated, this filter doesn't seem to work anymore.

I have been trying various things {airdate.timeStamp < (now.time + 2*24*60*60*1000)} but nothing has worked. Any help or insight would be greatly appreciated.
Wondering the same thing (if it'll fix my issue anyways), since I've been messing around with my filters a bit and just now ran into this post while trying to find out how to get future episodes to process correctly if I grab them before air date, got it to see future episodes while filtering down older episodes which is great but now trying to figure out how to filter out episodes that have no air date to them yet and haven't gotten that bit figured out..

Wondering if filtering down future episodes would cut out the episodes that have no air date? and if not then how exactly would I go about doing such a thing?
nuchdog
Posts: 4
Joined: 25 Dec 2016, 22:26

Re: filter timespamp doesn't work with 4.7.5

Post by nuchdog »

Getting closer. Also should answer your issue ZeroByDivide. I have been having some luck using the "?" Ternary operator.

Code: Select all

expression ? "if true or exists" : "if not true or does not exist"
see: http://groovy-lang.org/operators.html

Thus we can filter out episodes more than 5 days old and specials by:

Code: Select all

any{ age < 5 }{ special ? false : true }
which should return false if it is a special and true if it is not. I haven't tried this one yet.

Similarly, we can filter out episodes more than 5 days old and episodes that do not have an airdate by:

Code: Select all

any{ age < 5 }{ airdate ? true : false }
should return true if the episode has an airdate and false if it does not. I can confirm that this seems to work.

I am still going to have to play around and see if I can filter on a future airdate. i.e. episodes with an airdate only X days in the future.
Last edited by nuchdog on 27 Dec 2016, 06:19, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: filter timespamp doesn't work with 4.7.5

Post by rednoah »

Time zone issues (if there were any to begin with) should be fixed with r4667.
:idea: Please read the FAQ and How to Request Help.
nuchdog
Posts: 4
Joined: 25 Dec 2016, 22:26

Re: filter timespamp doesn't work with 4.7.5

Post by nuchdog »

Awesome, I will give it a shot and see if I can force the issue again. Otherwise

Code: Select all

any{ age < 5 }{ airdate ? true : false }
appears like it should work, or at least give filebot a shot at correctly matching the episode.
ZeroByDivide
Posts: 170
Joined: 16 Dec 2014, 01:39

Re: filter timespamp doesn't work with 4.7.5

Post by ZeroByDivide »

Great yes, thanks a bunch nuchdog

Code: Select all

any{ age < 5 }{ airdate ? true : false }
worked perfectly to weed out episodes that has no air date yet while allowing future episodes and keeping the age filter intact :D
Post Reply