mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-03 06:18:28 +01:00
fix library scan stopping and restarting itself
This commit is contained in:
@@ -80,7 +80,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
{
|
||||
var dbFile = Path.Combine(_appPaths.DataPath, "displaypreferences.db");
|
||||
|
||||
_connection = await SqliteExtensions.ConnectToDb(dbFile).ConfigureAwait(false);
|
||||
_connection = await SqliteExtensions.ConnectToDb(dbFile, _logger).ConfigureAwait(false);
|
||||
|
||||
string[] queries = {
|
||||
|
||||
|
||||
@@ -128,15 +128,18 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
/// Connects to db.
|
||||
/// </summary>
|
||||
/// <param name="dbPath">The db path.</param>
|
||||
/// <param name="logger">The logger.</param>
|
||||
/// <returns>Task{IDbConnection}.</returns>
|
||||
/// <exception cref="System.ArgumentNullException">dbPath</exception>
|
||||
public static async Task<IDbConnection> ConnectToDb(string dbPath)
|
||||
public static async Task<IDbConnection> ConnectToDb(string dbPath, ILogger logger)
|
||||
{
|
||||
if (string.IsNullOrEmpty(dbPath))
|
||||
{
|
||||
throw new ArgumentNullException("dbPath");
|
||||
}
|
||||
|
||||
logger.Info("Opening {0}", dbPath);
|
||||
|
||||
#if __MonoCS__
|
||||
var connectionstr = new SqliteConnectionStringBuilder
|
||||
{
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
|
||||
var chapterDbFile = Path.Combine(_appPaths.DataPath, "chapters.db");
|
||||
|
||||
var chapterConnection = SqliteExtensions.ConnectToDb(chapterDbFile).Result;
|
||||
var chapterConnection = SqliteExtensions.ConnectToDb(chapterDbFile, _logger).Result;
|
||||
|
||||
_chapterRepository = new SqliteChapterRepository(chapterConnection, logManager);
|
||||
}
|
||||
@@ -104,7 +104,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
{
|
||||
var dbFile = Path.Combine(_appPaths.DataPath, "library.db");
|
||||
|
||||
_connection = await SqliteExtensions.ConnectToDb(dbFile).ConfigureAwait(false);
|
||||
_connection = await SqliteExtensions.ConnectToDb(dbFile, _logger).ConfigureAwait(false);
|
||||
|
||||
string[] queries = {
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
{
|
||||
var dbFile = Path.Combine(_appPaths.DataPath, "notifications.db");
|
||||
|
||||
_connection = await SqliteExtensions.ConnectToDb(dbFile).ConfigureAwait(false);
|
||||
_connection = await SqliteExtensions.ConnectToDb(dbFile, _logger).ConfigureAwait(false);
|
||||
|
||||
string[] queries = {
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
{
|
||||
var dbFile = Path.Combine(_appPaths.DataPath, "userdata_v2.db");
|
||||
|
||||
_connection = await SqliteExtensions.ConnectToDb(dbFile).ConfigureAwait(false);
|
||||
_connection = await SqliteExtensions.ConnectToDb(dbFile, _logger).ConfigureAwait(false);
|
||||
|
||||
string[] queries = {
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
{
|
||||
var dbFile = Path.Combine(_appPaths.DataPath, "users.db");
|
||||
|
||||
_connection = await SqliteExtensions.ConnectToDb(dbFile).ConfigureAwait(false);
|
||||
_connection = await SqliteExtensions.ConnectToDb(dbFile, _logger).ConfigureAwait(false);
|
||||
|
||||
string[] queries = {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user