Fixed sab title issue

Added profiling to OpenSharedconnection
pull/4/head
kay.one 13 years ago
parent f6ccb5e17c
commit 5fb2c61c77

@ -51,6 +51,7 @@ namespace NzbDrone.Core.Test
var ep = mocker.Resolve<EpisodeProvider>().GetEpisodesByParseResult(parseResult); var ep = mocker.Resolve<EpisodeProvider>().GetEpisodesByParseResult(parseResult);
ep.Should().HaveCount(1); ep.Should().HaveCount(1);
parseResult.EpisodeTitle.Should().Be(fakeEpisode.Title);
ep.First().ShouldHave().AllPropertiesBut(e => e.Series); ep.First().ShouldHave().AllPropertiesBut(e => e.Series);
} }
@ -138,6 +139,7 @@ namespace NzbDrone.Core.Test
ep.Should().HaveCount(2); ep.Should().HaveCount(2);
db.Fetch<Episode>().Should().HaveCount(2); db.Fetch<Episode>().Should().HaveCount(2);
ep.First().ShouldHave().AllPropertiesBut(e => e.Series); ep.First().ShouldHave().AllPropertiesBut(e => e.Series);
parseResult.EpisodeTitle.Should().Be(fakeEpisode.Title);
} }
[Test] [Test]

@ -355,16 +355,19 @@ namespace PetaPoco
// Open a connection (can be nested) // Open a connection (can be nested)
public void OpenSharedConnection() public void OpenSharedConnection()
{ {
if (_sharedConnectionDepth == 0) using (MvcMiniProfiler.MiniProfiler.StepStatic("OpenSharedConnection"))
{ {
_sharedConnection = _factory.CreateConnection(); if (_sharedConnectionDepth == 0)
_sharedConnection.ConnectionString = _connectionString; {
_sharedConnection.Open(); _sharedConnection = _factory.CreateConnection();
_sharedConnection.ConnectionString = _connectionString;
_sharedConnection.Open();
if (KeepConnectionAlive) if (KeepConnectionAlive)
_sharedConnectionDepth++; // Make sure you call Dispose _sharedConnectionDepth++; // Make sure you call Dispose
}
_sharedConnectionDepth++;
} }
_sharedConnectionDepth++;
} }
/// <summary> /// <summary>

@ -137,6 +137,7 @@ namespace NzbDrone.Core.Providers
if (episodeInfo != null) if (episodeInfo != null)
{ {
result.Add(episodeInfo); result.Add(episodeInfo);
parseResult.EpisodeTitle = episodeInfo.Title;
} }
else else
{ {

@ -34,18 +34,21 @@ namespace NzbDrone
#if DEBUG #if DEBUG
Attach(); Attach();
#endif #endif
try if (Environment.UserInteractive)
{ {
Logger.Info("Starting default browser. {0}",IISController.AppUrl); try
Process.Start(IISController.AppUrl); {
} Logger.Info("Starting default browser. {0}", IISController.AppUrl);
catch(Exception e) Process.Start(IISController.AppUrl);
{ }
Logger.ErrorException("Failed to open URL in default browser.", e); catch (Exception e)
} {
while (true) Logger.ErrorException("Failed to open URL in default browser.", e);
{ }
Console.ReadLine(); while (true)
{
Console.ReadLine();
}
} }
} }
catch (Exception e) catch (Exception e)

Loading…
Cancel
Save