RuudBurger/CouchPotatoServer — pull request #1672 by mano3m (2013-04-28 17:08:54+00:00)
Title: Seeding support

Note: I had limited time for testing. I did test it with a few torrents, but as this is a significant change we might want some more testing...?

Design intent:
- After torrent downloading is complete the seeding phase starts, seeding parameters can be set per torrent provider
- When the seeding phase starts the checkSnatched function renames all files if (sym)linking/copying is used. The movie is set to done (!), the release to seeding status.
- Note that Direct symlink functionality is removed as the original file needs to end up in the movies store and not the downloader store (if the downloader cleans up his files, the original is deleted and the symlinks are useless)
- checkSnatched waits until downloader sets the download to completed (met the seeding parameters)
- When completed, checkSnatched intiates the renamer if move is used, or if linking is used asks the downloader to remove the torrent and clean-up it's files and sets the release to downloaded

Known items/issues:
- only implemented for uTorrent
- the renamer tags the folder with a .ignore file. when the downloader tries to clean up the folders it leaves this file and the folder.
- the force scan in the renamer during start-up of CPS can completely mess up a download in case the download completed before starting CPS and it beats checksnatched to it (which it did on my pc). This is why I commented it out. Note that this can also happen for NZBs or Torrents without this seeding Commit!

To do:
- implement for other torrent downloaders
- complete download removal for NZBs (remove from history in sabNZBd)
- failed download management for torrents (no seeders, takes too long, etc.)