1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-09-17 15:02:34 +02:00

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 @@ public void should_fix_forward_slashes()
items.Should().HaveCount(1);
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 @@ private ValidationFailure TestConnection()
_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);
if (version < new Version(2, 40))