Fixed: Parsing Transmission version for nightly builds

This commit is contained in:
Mark McDowall 2014-11-07 15:16:55 -08:00 committed by Taloth Saldono
parent 17f10c9ee5
commit d9cc0d4600
2 changed files with 14 additions and 1 deletions

View File

@ -346,5 +346,18 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.TransmissionTests
items.Should().HaveCount(1); items.Should().HaveCount(1);
items.First().OutputPath.Should().Be(@"C:\Downloads\Finished\transmission\" + _title); items.First().OutputPath.Should().Be(@"C:\Downloads\Finished\transmission\" + _title);
} }
[TestCase("2.84 ()")]
[TestCase("2.84+ ()")]
[TestCase("2.84 (other info)")]
[TestCase("2.84 (2.84)")]
public void should_version_should_only_check_version_number(String version)
{
Mocker.GetMock<ITransmissionProxy>()
.Setup(s => s.GetVersion(It.IsAny<TransmissionSettings>()))
.Returns(version);
Subject.Test();
}
} }
} }

View File

@ -188,7 +188,7 @@ namespace NzbDrone.Core.Download.Clients.Transmission
_logger.Debug("Transmission version information: {0}", versionString); _logger.Debug("Transmission version information: {0}", versionString);
var versionResult = Regex.Replace(versionString, @"\([^)]*\)", "", RegexOptions.IgnoreCase | RegexOptions.Multiline).Trim(); var versionResult = Regex.Match(versionString, @"(?<!\(|(\d|\.)+)(\d|\.)+(?!\)|(\d|\.)+)").Value;
var version = Version.Parse(versionResult); var version = Version.Parse(versionResult);
if (version < new Version(2, 40)) if (version < new Version(2, 40))