Here is an example config I just quickly put together. (Some additional genre filters removed.)
tasks:
test-task:
manual: yes
trakt_lookup: yes
trakt_list:
account: my-trakt-account
list: trending
type: shows
if:
- (now|formatdate('%Y')|int - title|re_replace('^.*\((\d{4})\).*$','\`')|int ) > 0: reject
regexp:
reject:
- reality: {from: trakt_genres}
exec:
on_start:
phase: echo "on_start..."
on_input:
phase: echo "on_input..."
on_filter:
phase: echo "on_filter..."
on_output:
phase: echo "on_output..."
on_exit:
phase: echo "on_exit..."
The expected order of operations would be that the if statement is able to reject entries before the regexp during the input phase.
That being said, the debug output shows this (truncated):
2019-05-30 18:36 INFO manager Test database created
2019-05-30 18:36 VERBOSE task_queue There are 1 tasks to execute. Shutdown will commence when they have completed.
2019-05-30 18:36 VERBOSE trakt_list test-task Retrieving `shows` list `trending`
2019-05-30 18:36 INFO exec test-task Would execute: echo "on_start..."
2019-05-30 18:36 INFO exec test-task Would execute: echo "on_input..."
2019-05-30 18:36 VERBOSE details test-task Produced 610 entries.
2019-05-30 18:37 VERBOSE task test-task REJECTED: `iZombie (2015) S01E01` by regexp plugin because regexp 'Crime' matched field 'trakt_genres'
2019-05-30 19:13 VERBOSE task test-task REJECTED: ...
2019-05-30 19:13 VERBOSE task test-task REJECTED: `24 Hours in A&E (2011) S01E01` by regexp plugin because regexp 'Documentary' matched field 'trakt_genres'
2019-05-30 19:13 VERBOSE task test-task ACCEPTED: `iCarly (2007) S01E01` by series plugin because choosing first acceptable match
2019-05-30 19:13 VERBOSE task test-task ACCEPTED: ...
2019-05-30 19:13 VERBOSE task test-task ACCEPTED: `11.22.63 (2016) S01E01` by series plugin because choosing first acceptable match
2019-05-30 19:13 VERBOSE task test-task REJECTED: `iCarly (2007) S01E01` by if plugin because matched requirement: (now|formatdate('%Y')|int - title|re_replace('^.*\((\d{4})\).*$','\`')|int ) > 0
2019-05-30 19:13 VERBOSE task test-task REJECTED: ...
2019-05-30 19:13 VERBOSE task test-task REJECTED: `11.22.63 (2016) S01E01` by if plugin because matched requirement: (now|formatdate('%Y')|int - title|re_replace('^.*\((\d{4})\).*$','\`')|int ) > 0
2019-05-30 19:13 INFO exec test-task Would execute: echo "on_filter..."
2019-05-30 19:13 VERBOSE details test-task Summary - Accepted: 24 (Rejected: 586 Undecided: 0 Failed: 0)
2019-05-30 19:13 INFO exec test-task Would execute: echo "on_output..."
2019-05-30 19:13 INFO exec test-task Would execute: echo "on_exit..."