Only usermanager should have access to the userrepository

This commit is contained in:
Jose Alacan
2016-08-24 20:08:03 -04:00
parent 22ac006d4e
commit 08fb2707be
3 changed files with 4 additions and 15 deletions

View File

@@ -43,11 +43,6 @@ namespace MediaBrowser.Server.Implementations.Session
/// </summary>
private readonly IUserDataManager _userDataRepository;
/// <summary>
/// The _user repository
/// </summary>
private readonly IUserRepository _userRepository;
/// <summary>
/// The _logger
/// </summary>
@@ -99,11 +94,10 @@ namespace MediaBrowser.Server.Implementations.Session
private readonly SemaphoreSlim _sessionLock = new SemaphoreSlim(1, 1);
public SessionManager(IUserDataManager userDataRepository, ILogger logger, IUserRepository userRepository, ILibraryManager libraryManager, IUserManager userManager, IMusicManager musicManager, IDtoService dtoService, IImageProcessor imageProcessor, IJsonSerializer jsonSerializer, IServerApplicationHost appHost, IHttpClient httpClient, IAuthenticationRepository authRepo, IDeviceManager deviceManager, IMediaSourceManager mediaSourceManager)
public SessionManager(IUserDataManager userDataRepository, ILogger logger, ILibraryManager libraryManager, IUserManager userManager, IMusicManager musicManager, IDtoService dtoService, IImageProcessor imageProcessor, IJsonSerializer jsonSerializer, IServerApplicationHost appHost, IHttpClient httpClient, IAuthenticationRepository authRepo, IDeviceManager deviceManager, IMediaSourceManager mediaSourceManager)
{
_userDataRepository = userDataRepository;
_logger = logger;
_userRepository = userRepository;
_libraryManager = libraryManager;
_userManager = userManager;
_musicManager = musicManager;
@@ -253,8 +247,7 @@ namespace MediaBrowser.Server.Implementations.Session
{
try
{
// Save this directly. No need to fire off all the events for this.
await _userRepository.SaveUser(user, CancellationToken.None).ConfigureAwait(false);
await _userManager.UpdateUser(user).ConfigureAwait(false);
}
catch (Exception ex)
{