mirror of https://github.com/Radarr/Radarr
fixed issue where series controller was still going to db for every file.
Increased log level tweaked connection string to sqlite
This commit is contained in:
parent
351f73b520
commit
cbfbb87926
|
@ -21,7 +21,7 @@ namespace NzbDrone.Core.Datastore
|
||||||
|
|
||||||
public static string GetConnectionString(string path)
|
public static string GetConnectionString(string path)
|
||||||
{
|
{
|
||||||
return String.Format("Data Source={0};Version=3;Cache Size=30000;", path);
|
return String.Format("Data Source={0};Version=3;Cache Size=30000;Pooling=true;Default Timeout=2", path);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String MainConnectionString
|
public static String MainConnectionString
|
||||||
|
@ -44,10 +44,12 @@ namespace NzbDrone.Core.Datastore
|
||||||
public static IDatabase GetPetaPocoDb(string connectionString, Boolean profiled = true)
|
public static IDatabase GetPetaPocoDb(string connectionString, Boolean profiled = true)
|
||||||
{
|
{
|
||||||
MigrationsHelper.Run(connectionString, true);
|
MigrationsHelper.Run(connectionString, true);
|
||||||
DbConnection connection = new SQLiteConnection(connectionString);
|
var sqliteConnection = new SQLiteConnection(connectionString);
|
||||||
|
DbConnection connection = sqliteConnection;
|
||||||
|
|
||||||
if (profiled)
|
if (profiled)
|
||||||
{
|
{
|
||||||
connection = ProfiledDbConnection.Get(connection);
|
connection = ProfiledDbConnection.Get(sqliteConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
var db = new Database(connection);
|
var db = new Database(connection);
|
||||||
|
|
|
@ -31,7 +31,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("*", LogLevel.Info, sonicTarget));
|
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Debug, sonicTarget));
|
||||||
|
|
||||||
LogManager.Configuration.Reload();
|
LogManager.Configuration.Reload();
|
||||||
}
|
}
|
||||||
|
|
|
@ -223,16 +223,14 @@ namespace NzbDrone.Web.Controllers
|
||||||
var episodeFileId = 0;
|
var episodeFileId = 0;
|
||||||
var episodePath = String.Empty;
|
var episodePath = String.Empty;
|
||||||
var episodeQuality = String.Empty;
|
var episodeQuality = String.Empty;
|
||||||
EpisodeFile episodeFile = null;
|
|
||||||
|
|
||||||
if (e.EpisodeFileId > 0)
|
|
||||||
episodeFile = _mediaFileProvider.GetEpisodeFile(e.EpisodeFileId);
|
|
||||||
|
if (e.EpisodeFile != null)
|
||||||
if (episodeFile != null)
|
|
||||||
{
|
{
|
||||||
episodePath = episodeFile.Path;
|
episodePath = e.EpisodeFile.Path;
|
||||||
episodeFileId = episodeFile.EpisodeFileId;
|
episodeFileId = e.EpisodeFile.EpisodeFileId;
|
||||||
episodeQuality = episodeFile.Quality.ToString();
|
episodeQuality = e.EpisodeFile.Quality.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
episodes.Add(new EpisodeModel
|
episodes.Add(new EpisodeModel
|
||||||
|
|
Loading…
Reference in New Issue