Flexget/Flexget — pull request #232 by gazpachoking (2014-03-01 23:38:00+00:00)
Title: Subtasks, take 2

The idea here is to let any plugin that allows entry generation via input subplugins, (discover and configure_series,) have a more general way to get their input, that works like a full task (with manipulation and filtering.)

The first try left several problems:
- [ ] Subtask names ended up really long and crappy in logs
- [ ] Warnings in subtasks about lack of filter and output plugins is not desired
- [ ] emit_series totally went to shit

Possible TODOs/concerns:
- [x] ~~Make a new option for tasks, where every entry starts already accepted, rather than hacking in accept_all~~
Task now has auto_accept option, which subtasks turn on
- [x] ~~Right now, it makes and commits a new sqlalchemy session. Should it?~~
Added option to pass in sqlalchemy session to a task, task does not commit or close session when passed in
- [x] ~~requests session should maybe be transferred from main task?~~
Added option to init new Task with existing requests session
- [x] ~~discover plugin currently takes a list, rather than a plain dict. Change that, and just require use of `inputs` plugin for repeated input plugins? (we could even support backwards compatible configs if desired via inputs plugin)~~
Changed both discover and crossmatch to take a dict config that runs as a task.
- [x] ~~hrmmm... template/include plugin will not work in a subtask right now.~~ And.. I'm silly. They work fine.