Merge branch 'master' of git://github.com/kayone/NzbDrone
Conflicts: NzbDrone.Core.Test/ParserTest.cs
This commit is contained in:
commit
6dda51d0e7
|
@ -199,7 +199,7 @@ namespace NzbDrone.Core.Test
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase(0)]
|
[TestCase(0)]
|
||||||
[TestCase(-1)]
|
[TestCase(-1)]
|
||||||
[TestCase(-100)]
|
[TestCase(-100)]
|
||||||
|
|
|
@ -13,7 +13,7 @@ namespace NzbDrone.Core.Test
|
||||||
// ReSharper disable InconsistentNaming
|
// ReSharper disable InconsistentNaming
|
||||||
public class EpisodeStatusTest : TestBase
|
public class EpisodeStatusTest : TestBase
|
||||||
{
|
{
|
||||||
[Test]
|
|
||||||
[TestCase(1, false, false, EpisodeStatusType.NotAired)]
|
[TestCase(1, false, false, EpisodeStatusType.NotAired)]
|
||||||
[TestCase(-2, false, false, EpisodeStatusType.Missing)]
|
[TestCase(-2, false, false, EpisodeStatusType.Missing)]
|
||||||
[TestCase(1, true, false, EpisodeStatusType.Ready)]
|
[TestCase(1, true, false, EpisodeStatusType.Ready)]
|
||||||
|
@ -36,7 +36,6 @@ namespace NzbDrone.Core.Test
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase(1, false, false, EpisodeStatusType.Missing)]
|
[TestCase(1, false, false, EpisodeStatusType.Missing)]
|
||||||
[TestCase(-2, false, false, EpisodeStatusType.Missing)]
|
[TestCase(-2, false, false, EpisodeStatusType.Missing)]
|
||||||
[TestCase(1, true, false, EpisodeStatusType.Ready)]
|
[TestCase(1, true, false, EpisodeStatusType.Ready)]
|
||||||
|
@ -59,7 +58,6 @@ namespace NzbDrone.Core.Test
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase(1, false, false, EpisodeStatusType.Downloading)]
|
[TestCase(1, false, false, EpisodeStatusType.Downloading)]
|
||||||
[TestCase(-2, false, false, EpisodeStatusType.Downloading)]
|
[TestCase(-2, false, false, EpisodeStatusType.Downloading)]
|
||||||
[TestCase(1, true, false, EpisodeStatusType.Downloading)]
|
[TestCase(1, true, false, EpisodeStatusType.Downloading)]
|
||||||
|
@ -83,7 +81,7 @@ namespace NzbDrone.Core.Test
|
||||||
Assert.AreEqual(status, episode.Status);
|
Assert.AreEqual(status, episode.Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase(1, true, false, EpisodeStatusType.Ignored)]
|
[TestCase(1, true, false, EpisodeStatusType.Ignored)]
|
||||||
[TestCase(-2, true, false, EpisodeStatusType.Ignored)]
|
[TestCase(-2, true, false, EpisodeStatusType.Ignored)]
|
||||||
[TestCase(1, true, true, EpisodeStatusType.Ready)]
|
[TestCase(1, true, true, EpisodeStatusType.Ready)]
|
||||||
|
|
|
@ -23,7 +23,7 @@ namespace NzbDrone.Core.Test
|
||||||
// ReSharper disable InconsistentNaming
|
// ReSharper disable InconsistentNaming
|
||||||
public class IndexerTests : TestBase
|
public class IndexerTests : TestBase
|
||||||
{
|
{
|
||||||
[Test]
|
|
||||||
[TestCase("nzbsorg.xml", 0)]
|
[TestCase("nzbsorg.xml", 0)]
|
||||||
[TestCase("nzbsrus.xml", 6)]
|
[TestCase("nzbsrus.xml", 6)]
|
||||||
[TestCase("newzbin.xml", 1)]
|
[TestCase("newzbin.xml", 1)]
|
||||||
|
@ -90,7 +90,7 @@ namespace NzbDrone.Core.Test
|
||||||
ExceptionVerification.ExcpectedWarns(1);
|
ExceptionVerification.ExcpectedWarns(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase("Adventure.Inc.S03E19.DVDRip.XviD-OSiTV", 3, 19, QualityTypes.DVD)]
|
[TestCase("Adventure.Inc.S03E19.DVDRip.XviD-OSiTV", 3, 19, QualityTypes.DVD)]
|
||||||
public void custome_parser_partial_success(string title, int season, int episode, QualityTypes quality)
|
public void custome_parser_partial_success(string title, int season, int episode, QualityTypes quality)
|
||||||
{
|
{
|
||||||
|
@ -117,7 +117,7 @@ namespace NzbDrone.Core.Test
|
||||||
Assert.AreEqual(quality, result.Quality.QualityType);
|
Assert.AreEqual(quality, result.Quality.QualityType);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase("Adventure.Inc.DVDRip.XviD-OSiTV")]
|
[TestCase("Adventure.Inc.DVDRip.XviD-OSiTV")]
|
||||||
public void custome_parser_full_parse(string title)
|
public void custome_parser_full_parse(string title)
|
||||||
{
|
{
|
||||||
|
|
|
@ -205,18 +205,17 @@ namespace NzbDrone.Core.Test
|
||||||
}
|
}
|
||||||
|
|
||||||
//Should Download
|
//Should Download
|
||||||
[Test]
|
[TestCase(QualityTypes.SDTV, true, QualityTypes.HDTV, false, true)]
|
||||||
[TestCase(QualityTypes.SDTV, true, QualityTypes.HDTV, false, true)]
|
[TestCase(QualityTypes.DVD, true, QualityTypes.Bluray720p, true, true)]
|
||||||
[TestCase(QualityTypes.DVD, true, QualityTypes.Bluray720p, true, true)]
|
[TestCase(QualityTypes.HDTV, false, QualityTypes.HDTV, true, true)]
|
||||||
[TestCase(QualityTypes.HDTV, false, QualityTypes.HDTV, true, true)]
|
[TestCase(QualityTypes.HDTV, false, QualityTypes.HDTV, false, false)]
|
||||||
[TestCase(QualityTypes.HDTV, false, QualityTypes.HDTV, false, false)]
|
[TestCase(QualityTypes.Bluray720p, true, QualityTypes.Bluray1080p, false, false)]
|
||||||
[TestCase(QualityTypes.Bluray720p, true, QualityTypes.Bluray1080p, false, false)]
|
[TestCase(QualityTypes.HDTV, true, QualityTypes.Bluray720p, true, true)]
|
||||||
[TestCase(QualityTypes.HDTV, true, QualityTypes.Bluray720p, true, true)]
|
[TestCase(QualityTypes.Bluray1080p, true, QualityTypes.Bluray720p, true, false)]
|
||||||
[TestCase(QualityTypes.Bluray1080p, true, QualityTypes.Bluray720p, true, false)]
|
[TestCase(QualityTypes.Bluray1080p, true, QualityTypes.Bluray720p, false, false)]
|
||||||
[TestCase(QualityTypes.Bluray1080p, true, QualityTypes.Bluray720p, false, false)]
|
[TestCase(QualityTypes.Bluray1080p, false, QualityTypes.Bluray720p, true, false)]
|
||||||
[TestCase(QualityTypes.Bluray1080p, false, QualityTypes.Bluray720p, true, false)]
|
[TestCase(QualityTypes.HDTV, false, QualityTypes.Bluray720p, true, true)]
|
||||||
[TestCase(QualityTypes.HDTV, false, QualityTypes.Bluray720p, true, true)]
|
[TestCase(QualityTypes.HDTV, true, QualityTypes.HDTV, false, false)]
|
||||||
[TestCase(QualityTypes.HDTV, true, QualityTypes.HDTV, false, false)]
|
|
||||||
public void Is_upgrade(QualityTypes fileQuality, bool isFileProper, QualityTypes reportQuality,
|
public void Is_upgrade(QualityTypes fileQuality, bool isFileProper, QualityTypes reportQuality,
|
||||||
bool isReportProper, bool excpected)
|
bool isReportProper, bool excpected)
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,7 +17,6 @@ namespace NzbDrone.Core.Test
|
||||||
* Unreported.World.Chinas.Lost.Sons.WS.PDTV.XviD-FTP
|
* Unreported.World.Chinas.Lost.Sons.WS.PDTV.XviD-FTP
|
||||||
*/
|
*/
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase("Sonny.With.a.Chance.S02E15", "Sonny.With.a.Chance", 2, 15)]
|
[TestCase("Sonny.With.a.Chance.S02E15", "Sonny.With.a.Chance", 2, 15)]
|
||||||
[TestCase("Two.and.a.Half.Me.103.720p.HDTV.X264-DIMENSION", "Two.and.a.Half.Me", 1, 3)]
|
[TestCase("Two.and.a.Half.Me.103.720p.HDTV.X264-DIMENSION", "Two.and.a.Half.Me", 1, 3)]
|
||||||
[TestCase("Two.and.a.Half.Me.113.720p.HDTV.X264-DIMENSION", "Two.and.a.Half.Me", 1, 13)]
|
[TestCase("Two.and.a.Half.Me.113.720p.HDTV.X264-DIMENSION", "Two.and.a.Half.Me", 1, 13)]
|
||||||
|
@ -63,7 +62,6 @@ namespace NzbDrone.Core.Test
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase("WEEDS.S03E01-06.DUAL.BDRip.XviD.AC3.-HELLYWOOD", QualityTypes.DVD)]
|
[TestCase("WEEDS.S03E01-06.DUAL.BDRip.XviD.AC3.-HELLYWOOD", QualityTypes.DVD)]
|
||||||
[TestCase("WEEDS.S03E01-06.DUAL.BDRip.X-viD.AC3.-HELLYWOOD", QualityTypes.DVD)]
|
[TestCase("WEEDS.S03E01-06.DUAL.BDRip.X-viD.AC3.-HELLYWOOD", QualityTypes.DVD)]
|
||||||
[TestCase("WEEDS.S03E01-06.DUAL.BDRip.AC3.-HELLYWOOD", QualityTypes.DVD)]
|
[TestCase("WEEDS.S03E01-06.DUAL.BDRip.AC3.-HELLYWOOD", QualityTypes.DVD)]
|
||||||
|
@ -123,7 +121,7 @@ namespace NzbDrone.Core.Test
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
[Timeout(1000)]
|
[Timeout(1000)]
|
||||||
[TestCase("WEEDS.S03E01-06.DUAL.BDRip.XviD.AC3.-HELLYWOOD", "WEEDS", 3, new[] { 1, 2, 3, 4, 5, 6 }, 6)]
|
[TestCase("WEEDS.S03E01-06.DUAL.BDRip.XviD.AC3.-HELLYWOOD", "WEEDS", 3, new[] { 1, 2, 3, 4, 5, 6 }, 6)]
|
||||||
[TestCase("Two.and.a.Half.Men.103.104.720p.HDTV.X264-DIMENSION", "Two.and.a.Half.Men", 1, new[] { 3, 4 }, 2)]
|
[TestCase("Two.and.a.Half.Men.103.104.720p.HDTV.X264-DIMENSION", "Two.and.a.Half.Men", 1, new[] { 3, 4 }, 2)]
|
||||||
|
@ -131,7 +129,7 @@ namespace NzbDrone.Core.Test
|
||||||
[TestCase("The Borgias S01e01 e02 ShoHD On Demand 1080i DD5 1 ALANiS", "The Borgias", 1, new[] { 1, 2 }, 2)]
|
[TestCase("The Borgias S01e01 e02 ShoHD On Demand 1080i DD5 1 ALANiS", "The Borgias", 1, new[] { 1, 2 }, 2)]
|
||||||
[TestCase("Big Time Rush 1x01 to 10 480i DD2 0 Sianto", "Big Time Rush", 1, new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }, 10)]
|
[TestCase("Big Time Rush 1x01 to 10 480i DD2 0 Sianto", "Big Time Rush", 1, new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }, 10)]
|
||||||
[TestCase("White.Collar.2x04.2x05.720p.BluRay-FUTV", "White.Collar", 2, new[] { 4, 5 }, 2)]
|
[TestCase("White.Collar.2x04.2x05.720p.BluRay-FUTV", "White.Collar", 2, new[] { 4, 5 }, 2)]
|
||||||
[TestCase("Desperate.Housewives.S07E22E23.720p.HDTV.X264-DIMENSION", "Desperate.Housewives", 7, new[] { 22,23 }, 2)]
|
[TestCase("Desperate.Housewives.S07E22E23.720p.HDTV.X264-DIMENSION", "Desperate.Housewives", 7, new[] { 22, 23 }, 2)]
|
||||||
//[Row("The.Kennedys.Part.1.and.Part.2.DSR.XviD-SYS", 1, new[] { 1, 2 })]
|
//[Row("The.Kennedys.Part.1.and.Part.2.DSR.XviD-SYS", 1, new[] { 1, 2 })]
|
||||||
[TestCase("S07E22 - 7x23 - And Lots of Security.. [HDTV].mkv", "", 7, new[] { 22, 23 }, 2)]
|
[TestCase("S07E22 - 7x23 - And Lots of Security.. [HDTV].mkv", "", 7, new[] { 22, 23 }, 2)]
|
||||||
[TestCase("Desparate Housewives - S07E22 - 7x23 - And Lots of Security.. [HDTV].mkv", "Desparate Housewives", 7, new[] { 22, 23 }, 2)]
|
[TestCase("Desparate Housewives - S07E22 - 7x23 - And Lots of Security.. [HDTV].mkv", "Desparate Housewives", 7, new[] { 22, 23 }, 2)]
|
||||||
|
@ -147,7 +145,7 @@ namespace NzbDrone.Core.Test
|
||||||
Assert.AreEqual(count, result.EpisodeNumbers.Count);
|
Assert.AreEqual(count, result.EpisodeNumbers.Count);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase("Conan 2011 04 18 Emma Roberts HDTV XviD BFF", "Conan", 2011, 04, 18)]
|
[TestCase("Conan 2011 04 18 Emma Roberts HDTV XviD BFF", "Conan", 2011, 04, 18)]
|
||||||
[TestCase("The Tonight Show With Jay Leno 2011 04 15 1080i HDTV DD5 1 MPEG2 TrollHD", "The Tonight Show With Jay Leno", 2011, 04, 15)]
|
[TestCase("The Tonight Show With Jay Leno 2011 04 15 1080i HDTV DD5 1 MPEG2 TrollHD", "The Tonight Show With Jay Leno", 2011, 04, 15)]
|
||||||
[TestCase("The.Daily.Show.2010.10.11.Johnny.Knoxville.iTouch-MW", "The.Daily.Show", 2010, 10, 11)]
|
[TestCase("The.Daily.Show.2010.10.11.Johnny.Knoxville.iTouch-MW", "The.Daily.Show", 2010, 10, 11)]
|
||||||
|
@ -164,7 +162,7 @@ namespace NzbDrone.Core.Test
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase("30.Rock.Season.04.HDTV.XviD-DIMENSION", "30.Rock", 4)]
|
[TestCase("30.Rock.Season.04.HDTV.XviD-DIMENSION", "30.Rock", 4)]
|
||||||
[TestCase("Parks.and.Recreation.S02.720p.x264-DIMENSION", "Parks.and.Recreation", 2)]
|
[TestCase("Parks.and.Recreation.S02.720p.x264-DIMENSION", "Parks.and.Recreation", 2)]
|
||||||
[TestCase("The.Office.US.S03.720p.x264-DIMENSION", "The.Office.US", 3)]
|
[TestCase("The.Office.US.S03.720p.x264-DIMENSION", "The.Office.US", 3)]
|
||||||
|
@ -176,7 +174,7 @@ namespace NzbDrone.Core.Test
|
||||||
Assert.AreEqual(0, result.EpisodeNumbers.Count);
|
Assert.AreEqual(0, result.EpisodeNumbers.Count);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase("Conan", "conan")]
|
[TestCase("Conan", "conan")]
|
||||||
[TestCase("The Tonight Show With Jay Leno", "tonightshowwithjayleno")]
|
[TestCase("The Tonight Show With Jay Leno", "tonightshowwithjayleno")]
|
||||||
[TestCase("The.Daily.Show", "dailyshow")]
|
[TestCase("The.Daily.Show", "dailyshow")]
|
||||||
|
@ -188,7 +186,7 @@ namespace NzbDrone.Core.Test
|
||||||
Assert.AreEqual(seriesName, result);
|
Assert.AreEqual(seriesName, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase(@"c:\test\", @"c:\test")]
|
[TestCase(@"c:\test\", @"c:\test")]
|
||||||
[TestCase(@"c:\\test\\", @"c:\test")]
|
[TestCase(@"c:\\test\\", @"c:\test")]
|
||||||
[TestCase(@"C:\\Test\\", @"C:\Test")]
|
[TestCase(@"C:\\Test\\", @"C:\Test")]
|
||||||
|
@ -200,7 +198,7 @@ namespace NzbDrone.Core.Test
|
||||||
Assert.AreEqual(clean, result);
|
Assert.AreEqual(clean, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase("CaPitAl", "capital")]
|
[TestCase("CaPitAl", "capital")]
|
||||||
[TestCase("peri.od", "period")]
|
[TestCase("peri.od", "period")]
|
||||||
[TestCase("this.^&%^**$%@#$!That", "thisthat")]
|
[TestCase("this.^&%^**$%@#$!That", "thisthat")]
|
||||||
|
@ -210,7 +208,7 @@ namespace NzbDrone.Core.Test
|
||||||
Assert.AreEqual(clean, result);
|
Assert.AreEqual(clean, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase("the")]
|
[TestCase("the")]
|
||||||
[TestCase("and")]
|
[TestCase("and")]
|
||||||
[TestCase("or")]
|
[TestCase("or")]
|
||||||
|
@ -240,7 +238,7 @@ namespace NzbDrone.Core.Test
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase("the")]
|
[TestCase("the")]
|
||||||
[TestCase("and")]
|
[TestCase("and")]
|
||||||
[TestCase("or")]
|
[TestCase("or")]
|
||||||
|
|
|
@ -40,15 +40,14 @@ namespace NzbDrone.Core.Test
|
||||||
Assert.AreEqual(result.Count, 2);
|
Assert.AreEqual(result.Count, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[TestCase("D:\\TV Shows\\")]
|
||||||
public void AddRootDir()
|
[TestCase("//server//folder")]
|
||||||
|
public void AddRootDir(string path)
|
||||||
{
|
{
|
||||||
//Setup
|
//Setup
|
||||||
var mocker = new AutoMoqer();
|
var mocker = new AutoMoqer();
|
||||||
mocker.SetConstant(MockLib.GetEmptyRepository());
|
mocker.SetConstant(MockLib.GetEmptyRepository());
|
||||||
|
|
||||||
const string path = @"C:\TV\";
|
|
||||||
|
|
||||||
//Act
|
//Act
|
||||||
var rootDirProvider = mocker.Resolve<RootDirProvider>();
|
var rootDirProvider = mocker.Resolve<RootDirProvider>();
|
||||||
rootDirProvider.Add(new RootDir { Path = path });
|
rootDirProvider.Add(new RootDir { Path = path });
|
||||||
|
@ -62,25 +61,26 @@ namespace NzbDrone.Core.Test
|
||||||
Assert.AreEqual(path, rootDirs.First().Path);
|
Assert.AreEqual(path, rootDirs.First().Path);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void UpdateRootDir()
|
[TestCase("D:\\TV Shows\\")]
|
||||||
|
[TestCase("//server//folder")]
|
||||||
|
public void UpdateRootDir(string newPath)
|
||||||
{
|
{
|
||||||
//Setup
|
//Setup
|
||||||
var mocker = new AutoMoqer();
|
var mocker = new AutoMoqer();
|
||||||
mocker.SetConstant(MockLib.GetEmptyRepository());
|
mocker.SetConstant(MockLib.GetEmptyRepository());
|
||||||
|
|
||||||
const string path = @"C:\TV2";
|
|
||||||
|
|
||||||
//Act
|
//Act
|
||||||
var rootDirProvider = mocker.Resolve<RootDirProvider>();
|
var rootDirProvider = mocker.Resolve<RootDirProvider>();
|
||||||
rootDirProvider.Add(new RootDir { Path = @"C:\TV" });
|
rootDirProvider.Add(new RootDir { Path = @"C:\TV" });
|
||||||
rootDirProvider.Update(new RootDir { Id = 1, Path = path });
|
rootDirProvider.Update(new RootDir { Id = 1, Path = newPath });
|
||||||
|
|
||||||
//Assert
|
//Assert
|
||||||
var rootDirs = rootDirProvider.GetAll();
|
var rootDirs = rootDirProvider.GetAll();
|
||||||
Assert.IsNotEmpty(rootDirs);
|
Assert.IsNotEmpty(rootDirs);
|
||||||
rootDirs.Should().HaveCount(1);
|
rootDirs.Should().HaveCount(1);
|
||||||
Assert.AreEqual(path, rootDirs.First().Path);
|
Assert.AreEqual(newPath, rootDirs.First().Path);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -144,5 +144,25 @@ namespace NzbDrone.Core.Test
|
||||||
var mocker = new AutoMoqer();
|
var mocker = new AutoMoqer();
|
||||||
mocker.Resolve<RootDirProvider>().GetUnmappedFolders("");
|
mocker.Resolve<RootDirProvider>().GetUnmappedFolders("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[TestCase("")]
|
||||||
|
[TestCase(null)]
|
||||||
|
[TestCase("BAD PATH")]
|
||||||
|
[ExpectedException(typeof(ArgumentException))]
|
||||||
|
public void invalid_folder_path_throws_on_add(string path)
|
||||||
|
{
|
||||||
|
var mocker = new AutoMoqer();
|
||||||
|
mocker.Resolve<RootDirProvider>().Add(new RootDir { Id = 0, Path = path });
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestCase("")]
|
||||||
|
[TestCase(null)]
|
||||||
|
[TestCase("BAD PATH")]
|
||||||
|
[ExpectedException(typeof(ArgumentException))]
|
||||||
|
public void invalid_folder_path_throws_on_update(string path)
|
||||||
|
{
|
||||||
|
var mocker = new AutoMoqer();
|
||||||
|
mocker.Resolve<RootDirProvider>().Update(new RootDir { Id = 2, Path = path });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -259,7 +259,7 @@ namespace NzbDrone.Core.Test
|
||||||
mocker.Resolve<SabProvider>().IsInQueue(String.Empty);
|
mocker.Resolve<SabProvider>().IsInQueue(String.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase(1, new[] { 2 }, "My Episode Title", QualityTypes.DVD, false, "My Series Name - 1x2 - My Episode Title [DVD]")]
|
[TestCase(1, new[] { 2 }, "My Episode Title", QualityTypes.DVD, false, "My Series Name - 1x2 - My Episode Title [DVD]")]
|
||||||
[TestCase(1, new[] { 2 }, "My Episode Title", QualityTypes.DVD, true, "My Series Name - 1x2 - My Episode Title [DVD] [Proper]")]
|
[TestCase(1, new[] { 2 }, "My Episode Title", QualityTypes.DVD, true, "My Series Name - 1x2 - My Episode Title [DVD] [Proper]")]
|
||||||
[TestCase(1, new[] { 2 }, "", QualityTypes.DVD, true, "My Series Name - 1x2 - [DVD] [Proper]")]
|
[TestCase(1, new[] { 2 }, "", QualityTypes.DVD, true, "My Series Name - 1x2 - [DVD] [Proper]")]
|
||||||
|
|
Binary file not shown.
|
@ -5,6 +5,8 @@ using FluentAssertions;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using NzbDrone.Core.Providers;
|
using NzbDrone.Core.Providers;
|
||||||
using NzbDrone.Core.Test.Framework;
|
using NzbDrone.Core.Test.Framework;
|
||||||
|
using TvdbLib.Data;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace NzbDrone.Core.Test
|
namespace NzbDrone.Core.Test
|
||||||
{
|
{
|
||||||
|
@ -12,7 +14,6 @@ namespace NzbDrone.Core.Test
|
||||||
// ReSharper disable InconsistentNaming
|
// ReSharper disable InconsistentNaming
|
||||||
public class TvDbProviderTest : TestBase
|
public class TvDbProviderTest : TestBase
|
||||||
{
|
{
|
||||||
[Test]
|
|
||||||
[TestCase("The Simpsons")]
|
[TestCase("The Simpsons")]
|
||||||
[TestCase("Family Guy")]
|
[TestCase("Family Guy")]
|
||||||
[TestCase("South Park")]
|
[TestCase("South Park")]
|
||||||
|
@ -24,7 +25,6 @@ namespace NzbDrone.Core.Test
|
||||||
result[0].SeriesName.Should().Be(title);
|
result[0].SeriesName.Should().Be(title);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase("The Simpsons")]
|
[TestCase("The Simpsons")]
|
||||||
[TestCase("Family Guy")]
|
[TestCase("Family Guy")]
|
||||||
[TestCase("South Park")]
|
[TestCase("South Park")]
|
||||||
|
@ -37,7 +37,7 @@ namespace NzbDrone.Core.Test
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
[TestCase(new object[] { "CAPITAL", "capital", true })]
|
[TestCase(new object[] { "CAPITAL", "capital", true })]
|
||||||
[TestCase(new object[] { "Something!!", "Something", true })]
|
[TestCase(new object[] { "Something!!", "Something", true })]
|
||||||
[TestCase(new object[] { "Simpsons 2000", "Simpsons", true })]
|
[TestCase(new object[] { "Simpsons 2000", "Simpsons", true })]
|
||||||
|
@ -94,18 +94,15 @@ namespace NzbDrone.Core.Test
|
||||||
//act
|
//act
|
||||||
var result = tvdbProvider.GetSeries(73141, true);
|
var result = tvdbProvider.GetSeries(73141, true);
|
||||||
|
|
||||||
var seasons = result.Episodes.Select(e => e.SeasonNumber)
|
var seasonsNumbers = result.Episodes.Select(e => e.SeasonNumber)
|
||||||
.Distinct().ToList();
|
.Distinct().ToList();
|
||||||
|
|
||||||
|
var seasons = new List<List<TvdbEpisode>>(seasonsNumbers.Count);
|
||||||
|
|
||||||
|
foreach (var season in seasonsNumbers)
|
||||||
var seasons1 = result.Episodes.Where(e => e.SeasonNumber == 1).ToList();
|
{
|
||||||
var seasons2 = result.Episodes.Where(e => e.SeasonNumber == 2).ToList();
|
seasons.Insert(season, result.Episodes.Where(e => e.SeasonNumber == season).ToList());
|
||||||
var seasons3 = result.Episodes.Where(e => e.SeasonNumber == 3).ToList();
|
}
|
||||||
var seasons4 = result.Episodes.Where(e => e.SeasonNumber == 4).ToList();
|
|
||||||
var seasons5 = result.Episodes.Where(e => e.SeasonNumber == 5).ToList();
|
|
||||||
var seasons6 = result.Episodes.Where(e => e.SeasonNumber == 6).ToList();
|
|
||||||
|
|
||||||
|
|
||||||
foreach (var episode in result.Episodes)
|
foreach (var episode in result.Episodes)
|
||||||
{
|
{
|
||||||
|
@ -113,19 +110,28 @@ namespace NzbDrone.Core.Test
|
||||||
}
|
}
|
||||||
|
|
||||||
//assert
|
//assert
|
||||||
seasons.Should().HaveCount(7);
|
seasonsNumbers.Should().HaveCount(7);
|
||||||
seasons1.Should().HaveCount(23);
|
seasons[1].Should().HaveCount(23);
|
||||||
seasons2.Should().HaveCount(19);
|
seasons[2].Should().HaveCount(19);
|
||||||
seasons3.Should().HaveCount(16);
|
seasons[3].Should().HaveCount(16);
|
||||||
seasons4.Should().HaveCount(20);
|
seasons[4].Should().HaveCount(20);
|
||||||
seasons5.Should().HaveCount(18);
|
seasons[5].Should().HaveCount(18);
|
||||||
|
|
||||||
|
foreach (var season in seasons)
|
||||||
|
{
|
||||||
|
season.Should().OnlyHaveUniqueItems();
|
||||||
|
}
|
||||||
|
|
||||||
|
//Make sure no episode number is skipped
|
||||||
|
foreach (var season in seasons)
|
||||||
|
{
|
||||||
|
for (int i = 1; i < season.Count; i++)
|
||||||
|
{
|
||||||
|
season.Should().Contain(c => c.EpisodeNumber == i, "Can't find Episode S{0:00}E{1:00}",
|
||||||
|
season[0].SeasonNumber, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
seasons1.Select(s => s.EpisodeNumber).Should().OnlyHaveUniqueItems();
|
|
||||||
seasons2.Select(s => s.EpisodeNumber).Should().OnlyHaveUniqueItems();
|
|
||||||
seasons3.Select(s => s.EpisodeNumber).Should().OnlyHaveUniqueItems();
|
|
||||||
seasons4.Select(s => s.EpisodeNumber).Should().OnlyHaveUniqueItems();
|
|
||||||
seasons5.Select(s => s.EpisodeNumber).Should().OnlyHaveUniqueItems();
|
|
||||||
seasons6.Select(s => s.EpisodeNumber).Should().OnlyHaveUniqueItems();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,11 +54,11 @@ namespace NzbDrone.Core
|
||||||
{
|
{
|
||||||
BindKernel();
|
BindKernel();
|
||||||
|
|
||||||
LogConfiguration.Setup();
|
LogConfiguration.StartDbLogging();
|
||||||
|
|
||||||
Migrations.Run(Connection.MainConnectionString, true);
|
Migrations.Run(Connection.MainConnectionString, true);
|
||||||
|
|
||||||
SetupDefaultQualityProfiles(_kernel.Get<IRepository>()); //Setup the default QualityProfiles on start-up
|
_kernel.Get<QualityProvider>().SetupDefaultProfiles();
|
||||||
|
|
||||||
BindIndexers();
|
BindIndexers();
|
||||||
BindJobs();
|
BindJobs();
|
||||||
|
@ -141,11 +141,11 @@ namespace NzbDrone.Core
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Logger.Debug("Attaching to parent process for automatic termination.");
|
var pid = Convert.ToInt32(Environment.GetEnvironmentVariable("NZBDRONE_PID"));
|
||||||
var pc = new PerformanceCounter("Process", "Creating Process ID",
|
|
||||||
Process.GetCurrentProcess().ProcessName);
|
Logger.Debug("Attaching to parent process ({0}) for automatic termination.", pid);
|
||||||
var pid = (int)pc.NextValue();
|
|
||||||
var hostProcess = Process.GetProcessById(pid);
|
var hostProcess = Process.GetProcessById(Convert.ToInt32(pid));
|
||||||
|
|
||||||
hostProcess.EnableRaisingEvents = true;
|
hostProcess.EnableRaisingEvents = true;
|
||||||
hostProcess.Exited += (delegate
|
hostProcess.Exited += (delegate
|
||||||
|
@ -154,7 +154,7 @@ namespace NzbDrone.Core
|
||||||
ShutDown();
|
ShutDown();
|
||||||
});
|
});
|
||||||
|
|
||||||
Logger.Debug("Successfully Attached to host. Process ID: {0}", pid);
|
Logger.Debug("Successfully Attached to host. Process [{0}]", hostProcess.ProcessName);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -167,55 +167,5 @@ namespace NzbDrone.Core
|
||||||
Logger.Info("Shutting down application.");
|
Logger.Info("Shutting down application.");
|
||||||
Process.GetCurrentProcess().Kill();
|
Process.GetCurrentProcess().Kill();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void SetupDefaultQualityProfiles(IRepository repository)
|
|
||||||
{
|
|
||||||
var sd = new QualityProfile
|
|
||||||
{
|
|
||||||
Name = "SD",
|
|
||||||
Allowed = new List<QualityTypes> { QualityTypes.SDTV, QualityTypes.DVD },
|
|
||||||
Cutoff = QualityTypes.SDTV
|
|
||||||
};
|
|
||||||
|
|
||||||
var hd = new QualityProfile
|
|
||||||
{
|
|
||||||
Name = "HD",
|
|
||||||
Allowed =
|
|
||||||
new List<QualityTypes> { QualityTypes.HDTV, QualityTypes.WEBDL, QualityTypes.Bluray720p },
|
|
||||||
Cutoff = QualityTypes.HDTV
|
|
||||||
};
|
|
||||||
|
|
||||||
//Add or Update SD
|
|
||||||
Logger.Debug(String.Format("Checking for default QualityProfile: {0}", sd.Name));
|
|
||||||
var sdDb = repository.Single<QualityProfile>(i => i.Name == sd.Name);
|
|
||||||
if (sdDb == null)
|
|
||||||
{
|
|
||||||
Logger.Debug(String.Format("Adding new default QualityProfile: {0}", sd.Name));
|
|
||||||
repository.Add(sd);
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Logger.Debug(String.Format("Updating default QualityProfile: {0}", sd.Name));
|
|
||||||
sd.QualityProfileId = sdDb.QualityProfileId;
|
|
||||||
repository.Update(sd);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Add or Update HD
|
|
||||||
Logger.Debug(String.Format("Checking for default QualityProfile: {0}", hd.Name));
|
|
||||||
var hdDb = repository.Single<QualityProfile>(i => i.Name == hd.Name);
|
|
||||||
if (hdDb == null)
|
|
||||||
{
|
|
||||||
Logger.Debug(String.Format("Adding new default QualityProfile: {0}", hd.Name));
|
|
||||||
repository.Add(hd);
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Logger.Debug(String.Format("Updating default QualityProfile: {0}", hd.Name));
|
|
||||||
hd.QualityProfileId = hdDb.QualityProfileId;
|
|
||||||
repository.Update(hd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Ninject;
|
using Ninject;
|
||||||
|
using Ninject.Activation;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NLog.Config;
|
using NLog.Config;
|
||||||
|
|
||||||
|
@ -17,12 +18,13 @@ namespace NzbDrone.Core.Instrumentation
|
||||||
|
|
||||||
LogManager.Configuration = new XmlLoggingConfiguration(Path.Combine(CentralDispatch.AppPath, "log.config"),
|
LogManager.Configuration = new XmlLoggingConfiguration(Path.Combine(CentralDispatch.AppPath, "log.config"),
|
||||||
false);
|
false);
|
||||||
LogManager.ConfigurationReloaded += ((s, e) => BindCustomLoggers());
|
|
||||||
BindCustomLoggers();
|
LogManager.ConfigurationReloaded += ((s, e) => StartDbLogging());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void BindCustomLoggers()
|
public static void StartDbLogging()
|
||||||
{
|
{
|
||||||
|
|
||||||
#if Release
|
#if Release
|
||||||
var exTarget = new ExceptioneerTarget();
|
var exTarget = new ExceptioneerTarget();
|
||||||
LogManager.Configuration.AddTarget("Exceptioneer", exTarget);
|
LogManager.Configuration.AddTarget("Exceptioneer", exTarget);
|
||||||
|
@ -30,7 +32,7 @@ namespace NzbDrone.Core.Instrumentation
|
||||||
#endif
|
#endif
|
||||||
var sonicTarget = CentralDispatch.NinjectKernel.Get<SubsonicTarget>();
|
var sonicTarget = CentralDispatch.NinjectKernel.Get<SubsonicTarget>();
|
||||||
LogManager.Configuration.AddTarget("DbLogger", sonicTarget);
|
LogManager.Configuration.AddTarget("DbLogger", sonicTarget);
|
||||||
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", NLog.LogLevel.Info, sonicTarget));
|
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Info, sonicTarget));
|
||||||
|
|
||||||
LogManager.Configuration.Reload();
|
LogManager.Configuration.Reload();
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,5 +53,39 @@ namespace NzbDrone.Core.Providers
|
||||||
{
|
{
|
||||||
return _repository.Single<QualityProfile>(q => q.QualityProfileId == profileId);
|
return _repository.Single<QualityProfile>(q => q.QualityProfileId == profileId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual void SetupDefaultProfiles()
|
||||||
|
{
|
||||||
|
Logger.Info("Setting up default quality profiles");
|
||||||
|
|
||||||
|
var profiles = GetAllProfiles();
|
||||||
|
|
||||||
|
var sd = new QualityProfile { Name = "SD", Allowed = new List<QualityTypes> { QualityTypes.SDTV, QualityTypes.DVD }, Cutoff = QualityTypes.SDTV };
|
||||||
|
|
||||||
|
var hd = new QualityProfile
|
||||||
|
{
|
||||||
|
Name = "HD",
|
||||||
|
Allowed = new List<QualityTypes> { QualityTypes.HDTV, QualityTypes.WEBDL, QualityTypes.Bluray720p },
|
||||||
|
Cutoff = QualityTypes.HDTV
|
||||||
|
};
|
||||||
|
|
||||||
|
//Add or Update SD
|
||||||
|
Logger.Debug(String.Format("Checking for default QualityProfile: {0}", sd.Name));
|
||||||
|
var sdDb = profiles.Where(p => p.Name == sd.Name).FirstOrDefault();
|
||||||
|
if (sdDb == null)
|
||||||
|
{
|
||||||
|
Logger.Debug(String.Format("Adding new default QualityProfile: {0}", sd.Name));
|
||||||
|
Add(sd);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Add or Update HD
|
||||||
|
Logger.Debug(String.Format("Checking for default QualityProfile: {0}", hd.Name));
|
||||||
|
var hdDb = profiles.Where(p => p.Name == hd.Name).FirstOrDefault();
|
||||||
|
if (hdDb == null)
|
||||||
|
{
|
||||||
|
Logger.Debug(String.Format("Adding new default QualityProfile: {0}", hd.Name));
|
||||||
|
Add(hd);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -11,15 +11,15 @@ namespace NzbDrone.Core.Providers
|
||||||
{
|
{
|
||||||
public class RootDirProvider
|
public class RootDirProvider
|
||||||
{
|
{
|
||||||
private readonly IRepository _sonioRepo;
|
private readonly IRepository _repository;
|
||||||
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
||||||
private readonly DiskProvider _diskProvider;
|
private readonly DiskProvider _diskProvider;
|
||||||
private readonly SeriesProvider _seriesProvider;
|
private readonly SeriesProvider _seriesProvider;
|
||||||
|
|
||||||
|
|
||||||
public RootDirProvider(IRepository sonicRepo, SeriesProvider seriesProvider, DiskProvider diskProvider)
|
public RootDirProvider(IRepository repository, SeriesProvider seriesProvider, DiskProvider diskProvider)
|
||||||
{
|
{
|
||||||
_sonioRepo = sonicRepo;
|
_repository = repository;
|
||||||
_diskProvider = diskProvider;
|
_diskProvider = diskProvider;
|
||||||
_seriesProvider = seriesProvider;
|
_seriesProvider = seriesProvider;
|
||||||
}
|
}
|
||||||
|
@ -28,27 +28,39 @@ namespace NzbDrone.Core.Providers
|
||||||
|
|
||||||
public virtual List<RootDir> GetAll()
|
public virtual List<RootDir> GetAll()
|
||||||
{
|
{
|
||||||
return _sonioRepo.All<RootDir>().ToList();
|
return _repository.All<RootDir>().ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual int Add(RootDir rootDir)
|
public virtual int Add(RootDir rootDir)
|
||||||
{
|
{
|
||||||
return Convert.ToInt32(_sonioRepo.Add(rootDir));
|
ValidatePath(rootDir);
|
||||||
|
|
||||||
|
return (int)_repository.Add(rootDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Remove(int rootDirId)
|
public virtual void Remove(int rootDirId)
|
||||||
{
|
{
|
||||||
_sonioRepo.Delete<RootDir>(rootDirId);
|
_repository.Delete<RootDir>(rootDirId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Update(RootDir rootDir)
|
public virtual void Update(RootDir rootDir)
|
||||||
{
|
{
|
||||||
_sonioRepo.Update(rootDir);
|
ValidatePath(rootDir);
|
||||||
|
|
||||||
|
_repository.Update(rootDir);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void ValidatePath(RootDir rootDir)
|
||||||
|
{
|
||||||
|
if (String.IsNullOrWhiteSpace(rootDir.Path) || !Path.IsPathRooted(rootDir.Path))
|
||||||
|
{
|
||||||
|
throw new ArgumentException("Invalid path");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual RootDir GetRootDir(int rootDirId)
|
public virtual RootDir GetRootDir(int rootDirId)
|
||||||
{
|
{
|
||||||
return _sonioRepo.Single<RootDir>(rootDirId);
|
return _repository.Single<RootDir>(rootDirId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> GetUnmappedFolders(string path)
|
public List<String> GetUnmappedFolders(string path)
|
||||||
|
|
|
@ -86,7 +86,7 @@ namespace NzbDrone.Core.Providers
|
||||||
//Fix American Dad's scene gongshow
|
//Fix American Dad's scene gongshow
|
||||||
if (result != null && result.Id == 73141)
|
if (result != null && result.Id == 73141)
|
||||||
{
|
{
|
||||||
var seasonOneEpisodeCount = result.Episodes.Where(e => e.SeasonNumber == 0).Count();
|
var seasonOneEpisodeCount = result.Episodes.Where(e => e.SeasonNumber == 1).Count();
|
||||||
var seasonOneId = result.Episodes.Where(e => e.SeasonNumber == 1).First().SeasonId;
|
var seasonOneId = result.Episodes.Where(e => e.SeasonNumber == 1).First().SeasonId;
|
||||||
|
|
||||||
foreach (var episode in result.Episodes)
|
foreach (var episode in result.Episodes)
|
||||||
|
|
|
@ -36,9 +36,6 @@ namespace NzbDrone.Web
|
||||||
{
|
{
|
||||||
base.OnApplicationStarted();
|
base.OnApplicationStarted();
|
||||||
|
|
||||||
Logger.Info("NZBDrone Starting up.");
|
|
||||||
CentralDispatch.DedicateToHost();
|
|
||||||
|
|
||||||
RegisterRoutes(RouteTable.Routes);
|
RegisterRoutes(RouteTable.Routes);
|
||||||
//base.OnApplicationStarted();
|
//base.OnApplicationStarted();
|
||||||
AreaRegistration.RegisterAllAreas();
|
AreaRegistration.RegisterAllAreas();
|
||||||
|
@ -48,6 +45,10 @@ namespace NzbDrone.Web
|
||||||
|
|
||||||
protected override IKernel CreateKernel()
|
protected override IKernel CreateKernel()
|
||||||
{
|
{
|
||||||
|
LogConfiguration.Setup();
|
||||||
|
Logger.Info("NZBDrone Starting up.");
|
||||||
|
CentralDispatch.DedicateToHost();
|
||||||
|
|
||||||
var kernel = CentralDispatch.NinjectKernel;
|
var kernel = CentralDispatch.NinjectKernel;
|
||||||
|
|
||||||
// kernel.Bind<IRepository>().ToConstant(kernel.Get<IRepository>("LogDb"));
|
// kernel.Bind<IRepository>().ToConstant(kernel.Get<IRepository>("LogDb"));
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
<rules>
|
<rules>
|
||||||
|
|
||||||
<logger name="IIS*" minlevel="Trace" writeTo="consoleTarget"/>
|
<logger name="IIS*" minlevel="Trace" writeTo="consoleTarget"/>
|
||||||
|
<logger name="NzbDrone.Web.MvcApplication" minlevel="Trace" writeTo="consoleTarget"/>
|
||||||
|
<logger name="NzbDrone.Core.CentralDispatch" minlevel="Trace" writeTo="consoleTarget"/>
|
||||||
<logger name="Application" minlevel="Trace" writeTo="consoleTarget"/>
|
<logger name="Application" minlevel="Trace" writeTo="consoleTarget"/>
|
||||||
<logger name="*" minlevel="Trace" writeTo="udpTarget"/>
|
<logger name="*" minlevel="Trace" writeTo="udpTarget"/>
|
||||||
<logger name="*" minlevel="Off" writeTo="xmlFile">
|
<logger name="*" minlevel="Off" writeTo="xmlFile">
|
||||||
|
|
|
@ -49,7 +49,8 @@ namespace NzbDrone
|
||||||
IISProcess.ErrorDataReceived += (OnErrorDataReceived);
|
IISProcess.ErrorDataReceived += (OnErrorDataReceived);
|
||||||
|
|
||||||
//Set Variables for the config file.
|
//Set Variables for the config file.
|
||||||
Environment.SetEnvironmentVariable("NZBDRONE_PATH", Config.ProjectRoot);
|
IISProcess.StartInfo.EnvironmentVariables.Add("NZBDRONE_PATH", Config.ProjectRoot);
|
||||||
|
IISProcess.StartInfo.EnvironmentVariables.Add("NZBDRONE_PID", Process.GetCurrentProcess().Id.ToString());
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -120,7 +121,7 @@ namespace NzbDrone
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var response = new WebClient().DownloadString(AppUrl + "/health");
|
var response = new WebClient().DownloadString(AppUrl + "/health");
|
||||||
|
|
||||||
if (!response.Contains("OK"))
|
if (!response.Contains("OK"))
|
||||||
{
|
{
|
||||||
throw new ServerException("Health services responded with an invalid response.");
|
throw new ServerException("Health services responded with an invalid response.");
|
||||||
|
@ -148,6 +149,12 @@ namespace NzbDrone
|
||||||
e.Data.StartsWith("Request ended:") || e.Data == ("IncrementMessages called"))
|
e.Data.StartsWith("Request ended:") || e.Data == ("IncrementMessages called"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (e.Data.Contains(" NzbDrone."))
|
||||||
|
{
|
||||||
|
Console.WriteLine(e.Data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
IISLogger.Trace(e.Data);
|
IISLogger.Trace(e.Data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue