From 53450bd514eec97d58eb18b8a01feab36475826b Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 6 Jul 2013 17:23:32 -0400 Subject: added a notifications service --- .../Persistence/SqliteChapterRepository.cs | 26 +++++----------------- 1 file changed, 5 insertions(+), 21 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Persistence/SqliteChapterRepository.cs') diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteChapterRepository.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteChapterRepository.cs index c472241e3..7db8a5a6f 100644 --- a/MediaBrowser.Server.Implementations/Persistence/SqliteChapterRepository.cs +++ b/MediaBrowser.Server.Implementations/Persistence/SqliteChapterRepository.cs @@ -1,10 +1,8 @@ -using MediaBrowser.Common.Configuration; -using MediaBrowser.Model.Entities; +using MediaBrowser.Model.Entities; using MediaBrowser.Model.Logging; using System; using System.Collections.Generic; using System.Data; -using System.IO; using System.Threading; using System.Threading.Tasks; @@ -16,30 +14,20 @@ namespace MediaBrowser.Server.Implementations.Persistence private readonly ILogger _logger; - /// - /// The _app paths - /// - private readonly IApplicationPaths _appPaths; - private IDbCommand _deleteChaptersCommand; private IDbCommand _saveChapterCommand; /// /// Initializes a new instance of the class. /// - /// The app paths. + /// The connection. /// The log manager. /// appPaths /// or /// jsonSerializer - public SqliteChapterRepository(IApplicationPaths appPaths, ILogManager logManager) + public SqliteChapterRepository(IDbConnection connection, ILogManager logManager) { - if (appPaths == null) - { - throw new ArgumentNullException("appPaths"); - } - - _appPaths = appPaths; + _connection = connection; _logger = logManager.GetLogger(GetType().Name); } @@ -48,12 +36,8 @@ namespace MediaBrowser.Server.Implementations.Persistence /// Opens the connection to the database /// /// Task. - public async Task Initialize() + public void Initialize() { - var dbFile = Path.Combine(_appPaths.DataPath, "chapters.db"); - - _connection = await SqliteExtensions.ConnectToDb(dbFile).ConfigureAwait(false); - string[] queries = { "create table if not exists chapters (ItemId GUID, ChapterIndex INT, StartPositionTicks BIGINT, Name TEXT, ImagePath TEXT, PRIMARY KEY (ItemId, ChapterIndex))", -- cgit v1.2.3