mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-07 06:17:14 -04:00
Only usermanager should have access to the userrepository
This commit is contained in:
parent
22ac006d4e
commit
08fb2707be
@ -43,11 +43,6 @@ namespace MediaBrowser.Server.Implementations.Session
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly IUserDataManager _userDataRepository;
|
private readonly IUserDataManager _userDataRepository;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The _user repository
|
|
||||||
/// </summary>
|
|
||||||
private readonly IUserRepository _userRepository;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The _logger
|
/// The _logger
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -99,11 +94,10 @@ namespace MediaBrowser.Server.Implementations.Session
|
|||||||
|
|
||||||
private readonly SemaphoreSlim _sessionLock = new SemaphoreSlim(1, 1);
|
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;
|
_userDataRepository = userDataRepository;
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_userRepository = userRepository;
|
|
||||||
_libraryManager = libraryManager;
|
_libraryManager = libraryManager;
|
||||||
_userManager = userManager;
|
_userManager = userManager;
|
||||||
_musicManager = musicManager;
|
_musicManager = musicManager;
|
||||||
@ -253,8 +247,7 @@ namespace MediaBrowser.Server.Implementations.Session
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Save this directly. No need to fire off all the events for this.
|
await _userManager.UpdateUser(user).ConfigureAwait(false);
|
||||||
await _userRepository.SaveUser(user, CancellationToken.None).ConfigureAwait(false);
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -423,8 +423,7 @@ namespace MediaBrowser.Server.Startup.Common
|
|||||||
RegisterSingleInstance(UserDataManager);
|
RegisterSingleInstance(UserDataManager);
|
||||||
|
|
||||||
UserRepository = await GetUserRepository().ConfigureAwait(false);
|
UserRepository = await GetUserRepository().ConfigureAwait(false);
|
||||||
RegisterSingleInstance(UserRepository);
|
|
||||||
|
|
||||||
var displayPreferencesRepo = new SqliteDisplayPreferencesRepository(LogManager, JsonSerializer, ApplicationPaths, NativeApp.GetDbConnector());
|
var displayPreferencesRepo = new SqliteDisplayPreferencesRepository(LogManager, JsonSerializer, ApplicationPaths, NativeApp.GetDbConnector());
|
||||||
DisplayPreferencesRepository = displayPreferencesRepo;
|
DisplayPreferencesRepository = displayPreferencesRepo;
|
||||||
RegisterSingleInstance(DisplayPreferencesRepository);
|
RegisterSingleInstance(DisplayPreferencesRepository);
|
||||||
@ -505,7 +504,7 @@ namespace MediaBrowser.Server.Startup.Common
|
|||||||
MediaSourceManager = new MediaSourceManager(ItemRepository, UserManager, LibraryManager, LogManager.GetLogger("MediaSourceManager"), JsonSerializer, FileSystemManager, UserDataManager);
|
MediaSourceManager = new MediaSourceManager(ItemRepository, UserManager, LibraryManager, LogManager.GetLogger("MediaSourceManager"), JsonSerializer, FileSystemManager, UserDataManager);
|
||||||
RegisterSingleInstance(MediaSourceManager);
|
RegisterSingleInstance(MediaSourceManager);
|
||||||
|
|
||||||
SessionManager = new SessionManager(UserDataManager, LogManager.GetLogger("SessionManager"), UserRepository, LibraryManager, UserManager, musicManager, DtoService, ImageProcessor, JsonSerializer, this, HttpClient, AuthenticationRepository, DeviceManager, MediaSourceManager);
|
SessionManager = new SessionManager(UserDataManager, LogManager.GetLogger("SessionManager"), LibraryManager, UserManager, musicManager, DtoService, ImageProcessor, JsonSerializer, this, HttpClient, AuthenticationRepository, DeviceManager, MediaSourceManager);
|
||||||
RegisterSingleInstance(SessionManager);
|
RegisterSingleInstance(SessionManager);
|
||||||
|
|
||||||
var dlnaManager = new DlnaManager(XmlSerializer, FileSystemManager, ApplicationPaths, LogManager.GetLogger("Dlna"), JsonSerializer, this);
|
var dlnaManager = new DlnaManager(XmlSerializer, FileSystemManager, ApplicationPaths, LogManager.GetLogger("Dlna"), JsonSerializer, this);
|
||||||
|
@ -65,9 +65,6 @@ EndProject
|
|||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Emby.Drawing", "Emby.Drawing\Emby.Drawing.csproj", "{08FFF49B-F175-4807-A2B5-73B0EBD9F716}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Emby.Drawing", "Emby.Drawing\Emby.Drawing.csproj", "{08FFF49B-F175-4807-A2B5-73B0EBD9F716}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(Performance) = preSolution
|
|
||||||
HasPerformanceSessions = true
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
Debug|Mixed Platforms = Debug|Mixed Platforms
|
Debug|Mixed Platforms = Debug|Mixed Platforms
|
||||||
|
Loading…
Reference in New Issue
Block a user