added user data manager, updated nuget
This commit is contained in:
parent
7dae0069d6
commit
9a4712cf22
|
@ -26,7 +26,7 @@ namespace MediaBrowser.Api
|
|||
/// <summary>
|
||||
/// The _user data repository
|
||||
/// </summary>
|
||||
private readonly IUserDataRepository _userDataRepository;
|
||||
private readonly IUserDataManager _userDataRepository;
|
||||
/// <summary>
|
||||
/// The _library manager
|
||||
/// </summary>
|
||||
|
@ -34,7 +34,7 @@ namespace MediaBrowser.Api
|
|||
private readonly IItemRepository _itemRepo;
|
||||
private readonly IDtoService _dtoService;
|
||||
|
||||
public AlbumsService(IUserManager userManager, IUserDataRepository userDataRepository, ILibraryManager libraryManager, IItemRepository itemRepo, IDtoService dtoService)
|
||||
public AlbumsService(IUserManager userManager, IUserDataManager userDataRepository, ILibraryManager libraryManager, IItemRepository itemRepo, IDtoService dtoService)
|
||||
{
|
||||
_userManager = userManager;
|
||||
_userDataRepository = userDataRepository;
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace MediaBrowser.Api
|
|||
/// <summary>
|
||||
/// The _user data repository
|
||||
/// </summary>
|
||||
private readonly IUserDataRepository _userDataRepository;
|
||||
private readonly IUserDataManager _userDataRepository;
|
||||
/// <summary>
|
||||
/// The _library manager
|
||||
/// </summary>
|
||||
|
@ -71,7 +71,7 @@ namespace MediaBrowser.Api
|
|||
/// <param name="libraryManager">The library manager.</param>
|
||||
/// <param name="itemRepo">The item repo.</param>
|
||||
/// <param name="dtoService">The dto service.</param>
|
||||
public GamesService(IUserManager userManager, IUserDataRepository userDataRepository, ILibraryManager libraryManager, IItemRepository itemRepo, IDtoService dtoService)
|
||||
public GamesService(IUserManager userManager, IUserDataManager userDataRepository, ILibraryManager libraryManager, IItemRepository itemRepo, IDtoService dtoService)
|
||||
{
|
||||
_userManager = userManager;
|
||||
_userDataRepository = userDataRepository;
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace MediaBrowser.Api
|
|||
/// <summary>
|
||||
/// The _user data repository
|
||||
/// </summary>
|
||||
private readonly IUserDataRepository _userDataRepository;
|
||||
private readonly IUserDataManager _userDataRepository;
|
||||
/// <summary>
|
||||
/// The _library manager
|
||||
/// </summary>
|
||||
|
@ -51,7 +51,7 @@ namespace MediaBrowser.Api
|
|||
/// <param name="userManager">The user manager.</param>
|
||||
/// <param name="userDataRepository">The user data repository.</param>
|
||||
/// <param name="libraryManager">The library manager.</param>
|
||||
public MoviesService(IUserManager userManager, IUserDataRepository userDataRepository, ILibraryManager libraryManager, IItemRepository itemRepo, IDtoService dtoService)
|
||||
public MoviesService(IUserManager userManager, IUserDataManager userDataRepository, ILibraryManager libraryManager, IItemRepository itemRepo, IDtoService dtoService)
|
||||
{
|
||||
_userManager = userManager;
|
||||
_userDataRepository = userDataRepository;
|
||||
|
|
|
@ -93,7 +93,7 @@ namespace MediaBrowser.Api
|
|||
/// <param name="includeInSearch">The include in search.</param>
|
||||
/// <param name="getSimilarityScore">The get similarity score.</param>
|
||||
/// <returns>ItemsResult.</returns>
|
||||
internal static ItemsResult GetSimilarItemsResult(IUserManager userManager, IItemRepository itemRepository, ILibraryManager libraryManager, IUserDataRepository userDataRepository, IDtoService dtoService, ILogger logger, BaseGetSimilarItemsFromItem request, Func<BaseItem, bool> includeInSearch, Func<BaseItem, BaseItem, int> getSimilarityScore)
|
||||
internal static ItemsResult GetSimilarItemsResult(IUserManager userManager, IItemRepository itemRepository, ILibraryManager libraryManager, IUserDataManager userDataRepository, IDtoService dtoService, ILogger logger, BaseGetSimilarItemsFromItem request, Func<BaseItem, bool> includeInSearch, Func<BaseItem, BaseItem, int> getSimilarityScore)
|
||||
{
|
||||
var user = request.UserId.HasValue ? userManager.GetUserById(request.UserId.Value) : null;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace MediaBrowser.Api
|
|||
/// <summary>
|
||||
/// The _user data repository
|
||||
/// </summary>
|
||||
private readonly IUserDataRepository _userDataRepository;
|
||||
private readonly IUserDataManager _userDataRepository;
|
||||
/// <summary>
|
||||
/// The _library manager
|
||||
/// </summary>
|
||||
|
@ -44,7 +44,7 @@ namespace MediaBrowser.Api
|
|||
/// <param name="userManager">The user manager.</param>
|
||||
/// <param name="userDataRepository">The user data repository.</param>
|
||||
/// <param name="libraryManager">The library manager.</param>
|
||||
public TrailersService(IUserManager userManager, IUserDataRepository userDataRepository, ILibraryManager libraryManager, IItemRepository itemRepo, IDtoService dtoService)
|
||||
public TrailersService(IUserManager userManager, IUserDataManager userDataRepository, ILibraryManager libraryManager, IItemRepository itemRepo, IDtoService dtoService)
|
||||
{
|
||||
_userManager = userManager;
|
||||
_userDataRepository = userDataRepository;
|
||||
|
|
|
@ -92,7 +92,7 @@ namespace MediaBrowser.Api
|
|||
/// <summary>
|
||||
/// The _user data repository
|
||||
/// </summary>
|
||||
private readonly IUserDataRepository _userDataRepository;
|
||||
private readonly IUserDataManager _userDataRepository;
|
||||
/// <summary>
|
||||
/// The _library manager
|
||||
/// </summary>
|
||||
|
@ -107,7 +107,7 @@ namespace MediaBrowser.Api
|
|||
/// <param name="userManager">The user manager.</param>
|
||||
/// <param name="userDataRepository">The user data repository.</param>
|
||||
/// <param name="libraryManager">The library manager.</param>
|
||||
public TvShowsService(IUserManager userManager, IUserDataRepository userDataRepository, ILibraryManager libraryManager, IItemRepository itemRepo, IDtoService dtoService)
|
||||
public TvShowsService(IUserManager userManager, IUserDataManager userDataRepository, ILibraryManager libraryManager, IItemRepository itemRepo, IDtoService dtoService)
|
||||
{
|
||||
_userManager = userManager;
|
||||
_userDataRepository = userDataRepository;
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
/// <param name="libraryManager">The library manager.</param>
|
||||
/// <param name="userDataRepository">The user data repository.</param>
|
||||
/// <param name="itemRepo">The item repo.</param>
|
||||
public ArtistsService(IUserManager userManager, ILibraryManager libraryManager, IUserDataRepository userDataRepository, IItemRepository itemRepo, IDtoService dtoService)
|
||||
public ArtistsService(IUserManager userManager, ILibraryManager libraryManager, IUserDataManager userDataRepository, IItemRepository itemRepo, IDtoService dtoService)
|
||||
: base(userManager, libraryManager, userDataRepository, itemRepo, dtoService)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@ using ServiceStack.ServiceHost;
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Api.UserLibrary
|
||||
{
|
||||
|
@ -27,7 +26,7 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
/// The library manager
|
||||
/// </summary>
|
||||
protected readonly ILibraryManager LibraryManager;
|
||||
protected readonly IUserDataRepository UserDataRepository;
|
||||
protected readonly IUserDataManager UserDataRepository;
|
||||
protected readonly IItemRepository ItemRepository;
|
||||
protected IDtoService DtoService { get; private set; }
|
||||
|
||||
|
@ -39,7 +38,7 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
/// <param name="userDataRepository">The user data repository.</param>
|
||||
/// <param name="itemRepository">The item repository.</param>
|
||||
/// <param name="dtoService">The dto service.</param>
|
||||
protected BaseItemsByNameService(IUserManager userManager, ILibraryManager libraryManager, IUserDataRepository userDataRepository, IItemRepository itemRepository, IDtoService dtoService)
|
||||
protected BaseItemsByNameService(IUserManager userManager, ILibraryManager libraryManager, IUserDataManager userDataRepository, IItemRepository itemRepository, IDtoService dtoService)
|
||||
{
|
||||
UserManager = userManager;
|
||||
LibraryManager = libraryManager;
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
|
||||
public class GameGenresService : BaseItemsByNameService<GameGenre>
|
||||
{
|
||||
public GameGenresService(IUserManager userManager, ILibraryManager libraryManager, IUserDataRepository userDataRepository, IItemRepository itemRepo, IDtoService dtoService)
|
||||
public GameGenresService(IUserManager userManager, ILibraryManager libraryManager, IUserDataManager userDataRepository, IItemRepository itemRepo, IDtoService dtoService)
|
||||
: base(userManager, libraryManager, userDataRepository, itemRepo, dtoService)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
/// </summary>
|
||||
public class GenresService : BaseItemsByNameService<Genre>
|
||||
{
|
||||
public GenresService(IUserManager userManager, ILibraryManager libraryManager, IUserDataRepository userDataRepository, IItemRepository itemRepo, IDtoService dtoService)
|
||||
public GenresService(IUserManager userManager, ILibraryManager libraryManager, IUserDataManager userDataRepository, IItemRepository itemRepo, IDtoService dtoService)
|
||||
: base(userManager, libraryManager, userDataRepository, itemRepo, dtoService)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -132,7 +132,7 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
/// <summary>
|
||||
/// The user data repository
|
||||
/// </summary>
|
||||
protected readonly IUserDataRepository UserDataRepository;
|
||||
protected readonly IUserDataManager UserDataRepository;
|
||||
|
||||
/// <summary>
|
||||
/// The library manager
|
||||
|
@ -145,7 +145,7 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
/// </summary>
|
||||
/// <param name="userDataRepository">The user data repository.</param>
|
||||
/// <param name="libraryManager">The library manager.</param>
|
||||
public ItemByNameUserDataService(IUserDataRepository userDataRepository, ILibraryManager libraryManager, IDtoService dtoService)
|
||||
public ItemByNameUserDataService(IUserDataManager userDataRepository, ILibraryManager libraryManager, IDtoService dtoService)
|
||||
{
|
||||
UserDataRepository = userDataRepository;
|
||||
LibraryManager = libraryManager;
|
||||
|
|
|
@ -188,7 +188,7 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
/// The _user manager
|
||||
/// </summary>
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IUserDataRepository _userDataRepository;
|
||||
private readonly IUserDataManager _userDataRepository;
|
||||
|
||||
/// <summary>
|
||||
/// The _library manager
|
||||
|
@ -206,7 +206,7 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
/// <param name="libraryManager">The library manager.</param>
|
||||
/// <param name="searchEngine">The search engine.</param>
|
||||
/// <param name="userDataRepository">The user data repository.</param>
|
||||
public ItemsService(IUserManager userManager, ILibraryManager libraryManager, ILibrarySearchEngine searchEngine, IUserDataRepository userDataRepository, ILocalizationManager localization, IDtoService dtoService)
|
||||
public ItemsService(IUserManager userManager, ILibraryManager libraryManager, ILibrarySearchEngine searchEngine, IUserDataManager userDataRepository, ILocalizationManager localization, IDtoService dtoService)
|
||||
{
|
||||
_userManager = userManager;
|
||||
_libraryManager = libraryManager;
|
||||
|
@ -322,7 +322,7 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
/// <param name="user">The user.</param>
|
||||
/// <param name="repository">The repository.</param>
|
||||
/// <returns>IEnumerable{BaseItem}.</returns>
|
||||
internal static IEnumerable<BaseItem> ApplyFilter(IEnumerable<BaseItem> items, ItemFilter filter, User user, IUserDataRepository repository)
|
||||
internal static IEnumerable<BaseItem> ApplyFilter(IEnumerable<BaseItem> items, ItemFilter filter, User user, IUserDataManager repository)
|
||||
{
|
||||
switch (filter)
|
||||
{
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
|
||||
public class MusicGenresService : BaseItemsByNameService<MusicGenre>
|
||||
{
|
||||
public MusicGenresService(IUserManager userManager, ILibraryManager libraryManager, IUserDataRepository userDataRepository, IItemRepository itemRepo, IDtoService dtoService)
|
||||
public MusicGenresService(IUserManager userManager, ILibraryManager libraryManager, IUserDataManager userDataRepository, IItemRepository itemRepo, IDtoService dtoService)
|
||||
: base(userManager, libraryManager, userDataRepository, itemRepo, dtoService)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
/// <param name="libraryManager">The library manager.</param>
|
||||
/// <param name="userDataRepository">The user data repository.</param>
|
||||
/// <param name="itemRepo">The item repo.</param>
|
||||
public PersonsService(IUserManager userManager, ILibraryManager libraryManager, IUserDataRepository userDataRepository, IItemRepository itemRepo, IDtoService dtoService)
|
||||
public PersonsService(IUserManager userManager, ILibraryManager libraryManager, IUserDataManager userDataRepository, IItemRepository itemRepo, IDtoService dtoService)
|
||||
: base(userManager, libraryManager, userDataRepository, itemRepo, dtoService)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
/// </summary>
|
||||
public class StudiosService : BaseItemsByNameService<Studio>
|
||||
{
|
||||
public StudiosService(IUserManager userManager, ILibraryManager libraryManager, IUserDataRepository userDataRepository, IItemRepository itemRepo, IDtoService dtoService)
|
||||
public StudiosService(IUserManager userManager, ILibraryManager libraryManager, IUserDataManager userDataRepository, IItemRepository itemRepo, IDtoService dtoService)
|
||||
: base(userManager, libraryManager, userDataRepository, itemRepo, dtoService)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -381,7 +381,7 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
/// <summary>
|
||||
/// The _user data repository
|
||||
/// </summary>
|
||||
private readonly IUserDataRepository _userDataRepository;
|
||||
private readonly IUserDataManager _userDataRepository;
|
||||
/// <summary>
|
||||
/// The _library manager
|
||||
/// </summary>
|
||||
|
@ -399,7 +399,7 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
/// <param name="sessionManager">The session manager.</param>
|
||||
/// <param name="dtoService">The dto service.</param>
|
||||
/// <exception cref="System.ArgumentNullException">jsonSerializer</exception>
|
||||
public UserLibraryService(IUserManager userManager, ILibraryManager libraryManager, IUserDataRepository userDataRepository, ISessionManager sessionManager, IDtoService dtoService)
|
||||
public UserLibraryService(IUserManager userManager, ILibraryManager libraryManager, IUserDataManager userDataRepository, ISessionManager sessionManager, IDtoService dtoService)
|
||||
{
|
||||
_userManager = userManager;
|
||||
_libraryManager = libraryManager;
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
/// </summary>
|
||||
private static readonly CultureInfo UsCulture = new CultureInfo("en-US");
|
||||
|
||||
public YearsService(IUserManager userManager, ILibraryManager libraryManager, IUserDataRepository userDataRepository, IItemRepository itemRepo, IDtoService dtoService)
|
||||
public YearsService(IUserManager userManager, ILibraryManager libraryManager, IUserDataManager userDataRepository, IItemRepository itemRepo, IDtoService dtoService)
|
||||
: base(userManager, libraryManager, userDataRepository, itemRepo, dtoService)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -1333,7 +1333,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
/// <param name="userManager">The user manager.</param>
|
||||
/// <returns>Task.</returns>
|
||||
/// <exception cref="System.ArgumentNullException"></exception>
|
||||
public virtual async Task MarkPlayed(User user, DateTime? datePlayed, IUserDataRepository userManager)
|
||||
public virtual async Task MarkPlayed(User user, DateTime? datePlayed, IUserDataManager userManager)
|
||||
{
|
||||
if (user == null)
|
||||
{
|
||||
|
@ -1359,7 +1359,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
/// <param name="userManager">The user manager.</param>
|
||||
/// <returns>Task.</returns>
|
||||
/// <exception cref="System.ArgumentNullException"></exception>
|
||||
public virtual async Task MarkUnplayed(User user, IUserDataRepository userManager)
|
||||
public virtual async Task MarkUnplayed(User user, IUserDataManager userManager)
|
||||
{
|
||||
if (user == null)
|
||||
{
|
||||
|
|
|
@ -1247,7 +1247,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
/// <param name="datePlayed">The date played.</param>
|
||||
/// <param name="userManager">The user manager.</param>
|
||||
/// <returns>Task.</returns>
|
||||
public override async Task MarkPlayed(User user, DateTime? datePlayed, IUserDataRepository userManager)
|
||||
public override async Task MarkPlayed(User user, DateTime? datePlayed, IUserDataManager userManager)
|
||||
{
|
||||
// Sweep through recursively and update status
|
||||
var tasks = GetRecursiveChildren(user, true).Where(i => !i.IsFolder).Select(c => c.MarkPlayed(user, datePlayed, userManager));
|
||||
|
@ -1261,7 +1261,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
/// <param name="user">The user.</param>
|
||||
/// <param name="userManager">The user manager.</param>
|
||||
/// <returns>Task.</returns>
|
||||
public override async Task MarkUnplayed(User user, IUserDataRepository userManager)
|
||||
public override async Task MarkUnplayed(User user, IUserDataManager userManager)
|
||||
{
|
||||
// Sweep through recursively and update status
|
||||
var tasks = GetRecursiveChildren(user, true).Where(i => !i.IsFolder).Select(c => c.MarkUnplayed(user, userManager));
|
||||
|
|
28
MediaBrowser.Controller/Library/IUserDataManager.cs
Normal file
28
MediaBrowser.Controller/Library/IUserDataManager.cs
Normal file
|
@ -0,0 +1,28 @@
|
|||
using MediaBrowser.Controller.Entities;
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Controller.Library
|
||||
{
|
||||
public interface IUserDataManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Saves the user data.
|
||||
/// </summary>
|
||||
/// <param name="userId">The user id.</param>
|
||||
/// <param name="key">The key.</param>
|
||||
/// <param name="userData">The user data.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task.</returns>
|
||||
Task SaveUserData(Guid userId, string key, UserItemData userData, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the user data.
|
||||
/// </summary>
|
||||
/// <param name="userId">The user id.</param>
|
||||
/// <param name="key">The key.</param>
|
||||
/// <returns>Task{UserItemData}.</returns>
|
||||
UserItemData GetUserData(Guid userId, string key);
|
||||
}
|
||||
}
|
|
@ -97,6 +97,7 @@
|
|||
<Compile Include="Library\ILibraryPrescanTask.cs" />
|
||||
<Compile Include="Library\IMetadataSaver.cs" />
|
||||
<Compile Include="Library\ItemUpdateType.cs" />
|
||||
<Compile Include="Library\IUserDataManager.cs" />
|
||||
<Compile Include="LiveTv\ChannelInfo.cs" />
|
||||
<Compile Include="LiveTv\ILiveTvManager.cs" />
|
||||
<Compile Include="LiveTv\ILiveTvService.cs" />
|
||||
|
|
|
@ -24,8 +24,7 @@ namespace MediaBrowser.Controller.Persistence
|
|||
/// <param name="userData">The user data.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task.</returns>
|
||||
Task SaveUserData(Guid userId, string key, UserItemData userData,
|
||||
CancellationToken cancellationToken);
|
||||
Task SaveUserData(Guid userId, string key, UserItemData userData, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the user data.
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Persistence;
|
||||
|
||||
namespace MediaBrowser.Controller.Sorting
|
||||
{
|
||||
|
@ -25,6 +24,6 @@ namespace MediaBrowser.Controller.Sorting
|
|||
/// Gets or sets the user data repository.
|
||||
/// </summary>
|
||||
/// <value>The user data repository.</value>
|
||||
IUserDataRepository UserDataRepository { get; set; }
|
||||
IUserDataManager UserDataRepository { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,12 +27,12 @@ namespace MediaBrowser.Server.Implementations.Dto
|
|||
private readonly ILogger _logger;
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IUserDataRepository _userDataRepository;
|
||||
private readonly IUserDataManager _userDataRepository;
|
||||
private readonly IItemRepository _itemRepo;
|
||||
|
||||
private readonly IImageProcessor _imageProcessor;
|
||||
|
||||
public DtoService(ILogger logger, ILibraryManager libraryManager, IUserManager userManager, IUserDataRepository userDataRepository, IItemRepository itemRepo, IImageProcessor imageProcessor)
|
||||
|
||||
public DtoService(ILogger logger, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataRepository, IItemRepository itemRepo, IImageProcessor imageProcessor)
|
||||
{
|
||||
_logger = logger;
|
||||
_libraryManager = libraryManager;
|
||||
|
|
|
@ -113,7 +113,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
|||
/// <summary>
|
||||
/// The _user data repository
|
||||
/// </summary>
|
||||
private readonly IUserDataRepository _userDataRepository;
|
||||
private readonly IUserDataManager _userDataRepository;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the configuration manager.
|
||||
|
@ -172,7 +172,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
|||
/// <param name="userManager">The user manager.</param>
|
||||
/// <param name="configurationManager">The configuration manager.</param>
|
||||
/// <param name="userDataRepository">The user data repository.</param>
|
||||
public LibraryManager(ILogger logger, ITaskManager taskManager, IUserManager userManager, IServerConfigurationManager configurationManager, IUserDataRepository userDataRepository, Func<IDirectoryWatchers> directoryWatchersFactory)
|
||||
public LibraryManager(ILogger logger, ITaskManager taskManager, IUserManager userManager, IServerConfigurationManager configurationManager, IUserDataManager userDataRepository, Func<IDirectoryWatchers> directoryWatchersFactory)
|
||||
{
|
||||
_logger = logger;
|
||||
_taskManager = taskManager;
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Persistence;
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.Library
|
||||
{
|
||||
/// <summary>
|
||||
/// Class UserDataManager
|
||||
/// </summary>
|
||||
public class UserDataManager : IUserDataManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the repository.
|
||||
/// </summary>
|
||||
/// <value>The repository.</value>
|
||||
public IUserDataRepository Repository { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Saves the user data.
|
||||
/// </summary>
|
||||
/// <param name="userId">The user id.</param>
|
||||
/// <param name="key">The key.</param>
|
||||
/// <param name="userData">The user data.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task.</returns>
|
||||
public Task SaveUserData(Guid userId, string key, UserItemData userData, CancellationToken cancellationToken)
|
||||
{
|
||||
return Repository.SaveUserData(userId, key, userData, cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the user data.
|
||||
/// </summary>
|
||||
/// <param name="userId">The user id.</param>
|
||||
/// <param name="key">The key.</param>
|
||||
/// <returns>Task{UserItemData}.</returns>
|
||||
public UserItemData GetUserData(Guid userId, string key)
|
||||
{
|
||||
return Repository.GetUserData(userId, key);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -142,6 +142,7 @@
|
|||
<Compile Include="Library\Resolvers\TV\SeasonResolver.cs" />
|
||||
<Compile Include="Library\Resolvers\TV\SeriesResolver.cs" />
|
||||
<Compile Include="Library\Resolvers\VideoResolver.cs" />
|
||||
<Compile Include="Library\UserDataManager.cs" />
|
||||
<Compile Include="Library\UserManager.cs" />
|
||||
<Compile Include="Library\Validators\ArtistsPostScanTask.cs" />
|
||||
<Compile Include="Library\Validators\ArtistsValidator.cs" />
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace MediaBrowser.Server.Implementations.Session
|
|||
/// <summary>
|
||||
/// The _user data repository
|
||||
/// </summary>
|
||||
private readonly IUserDataRepository _userDataRepository;
|
||||
private readonly IUserDataManager _userDataRepository;
|
||||
|
||||
/// <summary>
|
||||
/// The _user repository
|
||||
|
@ -69,7 +69,7 @@ namespace MediaBrowser.Server.Implementations.Session
|
|||
/// <param name="configurationManager">The configuration manager.</param>
|
||||
/// <param name="logger">The logger.</param>
|
||||
/// <param name="userRepository">The user repository.</param>
|
||||
public SessionManager(IUserDataRepository userDataRepository, IServerConfigurationManager configurationManager, ILogger logger, IUserRepository userRepository)
|
||||
public SessionManager(IUserDataManager userDataRepository, IServerConfigurationManager configurationManager, ILogger logger, IUserRepository userRepository)
|
||||
{
|
||||
_userDataRepository = userDataRepository;
|
||||
_configurationManager = configurationManager;
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
|
|||
/// Gets or sets the user data repository.
|
||||
/// </summary>
|
||||
/// <value>The user data repository.</value>
|
||||
public IUserDataRepository UserDataRepository { get; set; }
|
||||
public IUserDataManager UserDataRepository { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Compares the specified x.
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
|
|||
/// Gets or sets the user data repository.
|
||||
/// </summary>
|
||||
/// <value>The user data repository.</value>
|
||||
public IUserDataRepository UserDataRepository { get; set; }
|
||||
public IUserDataManager UserDataRepository { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Compares the specified x.
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
|
|||
/// Gets or sets the user data repository.
|
||||
/// </summary>
|
||||
/// <value>The user data repository.</value>
|
||||
public IUserDataRepository UserDataRepository { get; set; }
|
||||
public IUserDataManager UserDataRepository { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Compares the specified x.
|
||||
|
|
|
@ -55,7 +55,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
|
|||
/// Gets or sets the user data repository.
|
||||
/// </summary>
|
||||
/// <value>The user data repository.</value>
|
||||
public IUserDataRepository UserDataRepository { get; set; }
|
||||
public IUserDataManager UserDataRepository { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the user manager.
|
||||
|
@ -113,7 +113,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
|
|||
/// Gets or sets the user data repository.
|
||||
/// </summary>
|
||||
/// <value>The user data repository.</value>
|
||||
public IUserDataRepository UserDataRepository { get; set; }
|
||||
public IUserDataManager UserDataRepository { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the user manager.
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
|
|||
/// Gets or sets the user data repository.
|
||||
/// </summary>
|
||||
/// <value>The user data repository.</value>
|
||||
public IUserDataRepository UserDataRepository { get; set; }
|
||||
public IUserDataManager UserDataRepository { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Compares the specified x.
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
|
|||
/// Gets or sets the user data repository.
|
||||
/// </summary>
|
||||
/// <value>The user data repository.</value>
|
||||
public IUserDataRepository UserDataRepository { get; set; }
|
||||
public IUserDataManager UserDataRepository { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Compares the specified x.
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
|
|||
/// Gets or sets the user data repository.
|
||||
/// </summary>
|
||||
/// <value>The user data repository.</value>
|
||||
public IUserDataRepository UserDataRepository { get; set; }
|
||||
public IUserDataManager UserDataRepository { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the user manager.
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
|
|||
/// Gets or sets the user data repository.
|
||||
/// </summary>
|
||||
/// <value>The user data repository.</value>
|
||||
public IUserDataRepository UserDataRepository { get; set; }
|
||||
public IUserDataManager UserDataRepository { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Compares the specified x.
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
|
|||
/// Gets or sets the user data repository.
|
||||
/// </summary>
|
||||
/// <value>The user data repository.</value>
|
||||
public IUserDataRepository UserDataRepository { get; set; }
|
||||
public IUserDataManager UserDataRepository { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Compares the specified x.
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
|
|||
/// Gets or sets the user data repository.
|
||||
/// </summary>
|
||||
/// <value>The user data repository.</value>
|
||||
public IUserDataRepository UserDataRepository { get; set; }
|
||||
public IUserDataManager UserDataRepository { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Compares the specified x.
|
||||
|
|
|
@ -160,7 +160,7 @@ namespace MediaBrowser.ServerApplication
|
|||
/// Gets or sets the user data repository.
|
||||
/// </summary>
|
||||
/// <value>The user data repository.</value>
|
||||
private IUserDataRepository UserDataRepository { get; set; }
|
||||
private IUserDataManager UserDataManager { get; set; }
|
||||
private IUserRepository UserRepository { get; set; }
|
||||
internal IDisplayPreferencesRepository DisplayPreferencesRepository { get; set; }
|
||||
private IItemRepository ItemRepository { get; set; }
|
||||
|
@ -238,8 +238,8 @@ namespace MediaBrowser.ServerApplication
|
|||
|
||||
var mediaEncoderTask = RegisterMediaEncoder();
|
||||
|
||||
UserDataRepository = new SqliteUserDataRepository(ApplicationPaths, JsonSerializer, LogManager);
|
||||
RegisterSingleInstance(UserDataRepository);
|
||||
UserDataManager = new UserDataManager();
|
||||
RegisterSingleInstance(UserDataManager);
|
||||
|
||||
UserRepository = await GetUserRepository().ConfigureAwait(false);
|
||||
RegisterSingleInstance(UserRepository);
|
||||
|
@ -253,7 +253,7 @@ namespace MediaBrowser.ServerApplication
|
|||
UserManager = new UserManager(Logger, ServerConfigurationManager, UserRepository);
|
||||
RegisterSingleInstance(UserManager);
|
||||
|
||||
LibraryManager = new LibraryManager(Logger, TaskManager, UserManager, ServerConfigurationManager, UserDataRepository, () => DirectoryWatchers);
|
||||
LibraryManager = new LibraryManager(Logger, TaskManager, UserManager, ServerConfigurationManager, UserDataManager, () => DirectoryWatchers);
|
||||
RegisterSingleInstance(LibraryManager);
|
||||
|
||||
DirectoryWatchers = new DirectoryWatchers(LogManager, TaskManager, LibraryManager, ServerConfigurationManager);
|
||||
|
@ -264,7 +264,7 @@ namespace MediaBrowser.ServerApplication
|
|||
|
||||
RegisterSingleInstance<ILibrarySearchEngine>(() => new LuceneSearchEngine(ApplicationPaths, LogManager, LibraryManager));
|
||||
|
||||
SessionManager = new SessionManager(UserDataRepository, ServerConfigurationManager, Logger, UserRepository);
|
||||
SessionManager = new SessionManager(UserDataManager, ServerConfigurationManager, Logger, UserRepository);
|
||||
RegisterSingleInstance(SessionManager);
|
||||
|
||||
HttpServer = await _httpServerCreationTask.ConfigureAwait(false);
|
||||
|
@ -279,7 +279,7 @@ namespace MediaBrowser.ServerApplication
|
|||
ImageProcessor = new ImageProcessor(Logger, ServerConfigurationManager.ApplicationPaths);
|
||||
RegisterSingleInstance(ImageProcessor);
|
||||
|
||||
DtoService = new DtoService(Logger, LibraryManager, UserManager, UserDataRepository, ItemRepository, ImageProcessor);
|
||||
DtoService = new DtoService(Logger, LibraryManager, UserManager, UserDataManager, ItemRepository, ImageProcessor);
|
||||
RegisterSingleInstance(DtoService);
|
||||
|
||||
LiveTvManager = new LiveTvManager();
|
||||
|
@ -372,9 +372,13 @@ namespace MediaBrowser.ServerApplication
|
|||
/// Configures the user data repositories.
|
||||
/// </summary>
|
||||
/// <returns>Task.</returns>
|
||||
private Task ConfigureUserDataRepositories()
|
||||
private async Task ConfigureUserDataRepositories()
|
||||
{
|
||||
return UserDataRepository.Initialize();
|
||||
var repo = new SqliteUserDataRepository(ApplicationPaths, JsonSerializer, LogManager);
|
||||
|
||||
await repo.Initialize().ConfigureAwait(false);
|
||||
|
||||
((UserDataManager) UserDataManager).Repository = repo;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Common.Internal</id>
|
||||
<version>3.0.213</version>
|
||||
<version>3.0.214</version>
|
||||
<title>MediaBrowser.Common.Internal</title>
|
||||
<authors>Luke</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description>
|
||||
<copyright>Copyright © Media Browser 2013</copyright>
|
||||
<dependencies>
|
||||
<dependency id="MediaBrowser.Common" version="3.0.213" />
|
||||
<dependency id="MediaBrowser.Common" version="3.0.214" />
|
||||
<dependency id="NLog" version="2.0.1.2" />
|
||||
<dependency id="ServiceStack.Text" version="3.9.58" />
|
||||
<dependency id="SimpleInjector" version="2.3.2" />
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Common</id>
|
||||
<version>3.0.213</version>
|
||||
<version>3.0.214</version>
|
||||
<title>MediaBrowser.Common</title>
|
||||
<authors>Media Browser Team</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Server.Core</id>
|
||||
<version>3.0.213</version>
|
||||
<version>3.0.214</version>
|
||||
<title>Media Browser.Server.Core</title>
|
||||
<authors>Media Browser Team</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<description>Contains core components required to build plugins for Media Browser Server.</description>
|
||||
<copyright>Copyright © Media Browser 2013</copyright>
|
||||
<dependencies>
|
||||
<dependency id="MediaBrowser.Common" version="3.0.213" />
|
||||
<dependency id="MediaBrowser.Common" version="3.0.214" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
|
|
Loading…
Reference in New Issue
Block a user