Fixed issue where update provider called db in a loop.

pull/4/head
kay.one 13 years ago
parent 82e2cb2d1e
commit 85736029c8

@ -45,14 +45,15 @@ namespace NzbDrone.Core.Providers
private List<UpdatePackage> GetAvailablePackages() private List<UpdatePackage> GetAvailablePackages()
{ {
var updateList = new List<UpdatePackage>(); var updateList = new List<UpdatePackage>();
var rawUpdateList = _httpProvider.DownloadString(_configProvider.UpdateUrl); var updateUrl = _configProvider.UpdateUrl;
var rawUpdateList = _httpProvider.DownloadString(updateUrl);
var matches = parseRegex.Matches(rawUpdateList); var matches = parseRegex.Matches(rawUpdateList);
foreach (Match match in matches) foreach (Match match in matches)
{ {
var updatePackage = new UpdatePackage(); var updatePackage = new UpdatePackage();
updatePackage.FileName = match.Groups["filename"].Value; updatePackage.FileName = match.Groups["filename"].Value;
updatePackage.Url = _configProvider.UpdateUrl + updatePackage.FileName; updatePackage.Url = updateUrl + updatePackage.FileName;
updatePackage.Version = new Version(match.Groups["version"].Value); updatePackage.Version = new Version(match.Groups["version"].Value);
updateList.Add(updatePackage); updateList.Add(updatePackage);
} }

Loading…
Cancel
Save