2010-02-04, 01:02
edog1973 Wrote:Hi, I just discovered this a couple of days ago and I have to say that I love it!
The only issue I have right now is the lack of postprocessing for torrent downloads. I took a quick look at the code and decided that I could fix that. Here is what I came up with. I'm hoping that perhaps you would consider including the changes?
My approach is quite a bit different from the the current postprocessing. Your current approach had the downloading application essentially call back to notify when a download is finished where my idea is to periodically search through a download dir to find any video files and then try to process them.
First of all I have my torrent client set to move completed downloads to a specific folder. I set the TV Download Dir config option to point to the dir.
I slightly modified the doit() in processTV.py and added processDownloadDir(). See linked files. (I put big ugly comments in show exactly what I changed). Also I added processDownloadDir() to webserve.py. I then manually enter the url into the browser to call the page. My thought is that processDownloadDir would be called every x minuets / hours, perhaps at the search frequency.
processTV.py
webserve.py
Thanks
For starters, are you saying that it's working reliably with torrents? I haven't heard of anybody actually using it with torrents so that's great news for me :0)
About the post processing, what you've done is basically implemented this for me: https://code.google.com/p/sickbeard/issues/detail?id=3
One reason I haven't implemented it is because of the worry of incomplete files during the postprocessing (aka if Sick Beard scans the folder and post processes an episode while it's being copied). My solution (in my head) was to make an isFileBeingCopied() function that polls a file's size and if it's constant over a few seconds then assume it's not currently being copied, but I haven't gotten around to that yet. Sounds like if I do that you've done the rest :0)
Can you please attach your changes to the issue linked above? (in the form of a patch, if possible). Thanks for the help, I'll take a look at it when I have some time.