Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add subtask input plugin #2478

Merged
merged 13 commits into from
Dec 22, 2019
Prev Previous commit
Next Next commit
Simplify how seen plugin gets disabled a bit in subtasks.
Change subtask name to use > instead of .
  • Loading branch information
gazpachoking committed Nov 7, 2019
commit 4ab6be86c7adc25949bdbcb6c65836f5d98469f2
9 changes: 3 additions & 6 deletions flexget/plugins/input/subtask.py
Original file line number Diff line number Diff line change
@@ -22,14 +22,11 @@ class Subtask(object):
def on_task_input(self, task, config):
subtask_name = config
subtask_config = task.manager.config['tasks'].get(subtask_name, {})
# TODO: This seen disabling is super hacky, is there a better way?
if 'seen' not in subtask_config:
if isinstance(subtask_config.get('disable'), str):
subtask_config['disable'] = [subtask_config['disable']]
subtask_config.setdefault('disable', []).append('seen')
# TODO: This seen disabling is sorta hacky, is there a better way?
subtask_config.setdefault('seen', False)
input_task = Task(
task.manager,
'{}.{}'.format(task.name, subtask_name),
'{}>{}'.format(task.name, subtask_name),
config=subtask_config,
# TODO: Do we want to pass all options through? Things like inject don't make sense, but perhaps others do.
options=task.options,