Sonarr/Sonarr — pull request #130 by Taloth (2014-10-31 23:27:40+00:00)
Title: Added downloadclientid to DownloadedEpisodesScanCommand endpoint

This allows nzbToMedia to function properly in CDH environments. By submitting the downloadclientid we can associate the trackeddownload and mark it as imported.

I've moved the command handling to a separate service, this avoids cyclic ioc dependencies.
I haven't actually tested the endpoint, only the internals using unit tests.

Known points:
- Test in integrated environment to test the actual endpoint
- Check it with seeding torrents, nzbToMedia hardlinks to alternate dir.
- Verify the rejected/skipped logic and determine if we should set the command to Failed. (leading nzbtoMedia to believe it's trash, and fail the download, removing it, and ultimately triggering Failed download handling in drone)

Originally I intended to add a synchronous command, allowing nzbToMedia to wait for the rest response, but I can instruct @clinton-hall to poll using the trackedcommand id that was returned, allowing nzbToMedia to know when the command execution finished, and whether it was successful.

@markus101 Please look at this in some detail, since it is a pretty important part of our process. Lemme know if I missed something.