2019-01-13 15:03:10 -05:00
|
|
|
using System;
|
2019-01-13 14:26:31 -05:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using MediaBrowser.Controller.Chapters;
|
2014-06-09 15:16:14 -04:00
|
|
|
using MediaBrowser.Controller.Configuration;
|
|
|
|
using MediaBrowser.Controller.Library;
|
2014-06-10 13:36:06 -04:00
|
|
|
using MediaBrowser.Controller.Persistence;
|
|
|
|
using MediaBrowser.Model.Entities;
|
2018-12-13 08:18:25 -05:00
|
|
|
using Microsoft.Extensions.Logging;
|
2014-06-09 15:16:14 -04:00
|
|
|
|
|
|
|
namespace MediaBrowser.Providers.Chapters
|
|
|
|
{
|
|
|
|
public class ChapterManager : IChapterManager
|
|
|
|
{
|
|
|
|
private readonly ILibraryManager _libraryManager;
|
|
|
|
private readonly ILogger _logger;
|
|
|
|
private readonly IServerConfigurationManager _config;
|
2014-06-10 13:36:06 -04:00
|
|
|
private readonly IItemRepository _itemRepo;
|
2014-06-09 15:16:14 -04:00
|
|
|
|
2019-01-17 17:55:05 -05:00
|
|
|
public ChapterManager(
|
|
|
|
ILibraryManager libraryManager,
|
|
|
|
ILoggerFactory loggerFactory,
|
|
|
|
IServerConfigurationManager config,
|
|
|
|
IItemRepository itemRepo)
|
2014-06-09 15:16:14 -04:00
|
|
|
{
|
|
|
|
_libraryManager = libraryManager;
|
2019-01-17 17:55:05 -05:00
|
|
|
_logger = loggerFactory.CreateLogger(nameof(ChapterManager));
|
2014-06-09 15:16:14 -04:00
|
|
|
_config = config;
|
2014-06-10 13:36:06 -04:00
|
|
|
_itemRepo = itemRepo;
|
2014-06-09 15:16:14 -04:00
|
|
|
}
|
|
|
|
|
2017-08-26 20:32:33 -04:00
|
|
|
public void SaveChapters(string itemId, List<ChapterInfo> chapters)
|
2014-06-10 13:36:06 -04:00
|
|
|
{
|
2017-08-26 20:32:33 -04:00
|
|
|
_itemRepo.SaveChapters(new Guid(itemId), chapters);
|
2014-06-10 13:36:06 -04:00
|
|
|
}
|
2014-06-09 15:16:14 -04:00
|
|
|
}
|
|
|
|
}
|