Added DownloadFile method to HttpProvider.

Fixed Link that is returned from NzbMatrixProvider.NzbDownloadUrl.
IndexerProvider will now download the NZB to the disk if SABnzbd is not configured.
This commit is contained in:
Mark McDowall 2011-04-26 23:27:15 -07:00
commit 6f46a1211e
3 changed files with 33 additions and 6 deletions

View file

@ -50,6 +50,20 @@ namespace NzbDrone.Core.Providers.Core
return response.GetResponseStream();
}
public virtual bool DownloadFile(string address, string fileName)
{
try
{
var webClient = new WebClient();
webClient.DownloadFile(address, fileName);
return true;
}
catch (Exception ex)
{
Logger.Warn("Failed to get response from: {0}", address);
Logger.TraceException(ex.Message, ex);
return false;
}
}
}
}