Exemple #1
0
 public ItemDetailsContext(IApplicationHost appHost, IApiClient apiClient, IImageManager imageManager, IServerEvents serverEvents, INavigator navigator, IPresenter presenter, ISessionManager sessionManager)
     : base(appHost)
 {
     _apiClient = apiClient;
     _imageManager = imageManager;
     _serverEvents = serverEvents;
     _navigator = navigator;
     _presenter = presenter;
     _sessionManager = sessionManager;
     _generators = appHost.GetExports<IItemDetailSectionGenerator>();
 }
        public UserManager(
            JellyfinDbProvider dbProvider,
            ICryptoProvider cryptoProvider,
            INetworkManager networkManager,
            IApplicationHost appHost,
            IImageProcessor imageProcessor,
            ILogger <UserManager> logger)
        {
            _dbProvider     = dbProvider;
            _cryptoProvider = cryptoProvider;
            _networkManager = networkManager;
            _appHost        = appHost;
            _imageProcessor = imageProcessor;
            _logger         = logger;

            _passwordResetProviders  = appHost.GetExports <IPasswordResetProvider>();
            _authenticationProviders = appHost.GetExports <IAuthenticationProvider>();

            _invalidAuthProvider           = _authenticationProviders.OfType <InvalidAuthProvider>().First();
            _defaultAuthenticationProvider = _authenticationProviders.OfType <DefaultAuthenticationProvider>().First();
            _defaultPasswordResetProvider  = _passwordResetProviders.OfType <DefaultPasswordResetProvider>().First();
        }
Exemple #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UserManager"/> class.
        /// </summary>
        /// <param name="dbProvider">The database provider.</param>
        /// <param name="eventManager">The event manager.</param>
        /// <param name="cryptoProvider">The cryptography provider.</param>
        /// <param name="networkManager">The network manager.</param>
        /// <param name="appHost">The application host.</param>
        /// <param name="imageProcessor">The image processor.</param>
        /// <param name="logger">The logger.</param>
        public UserManager(
            JellyfinDbProvider dbProvider,
            IEventManager eventManager,
            ICryptoProvider cryptoProvider,
            INetworkManager networkManager,
            IApplicationHost appHost,
            IImageProcessor imageProcessor,
            ILogger <UserManager> logger)
        {
            _dbProvider     = dbProvider;
            _eventManager   = eventManager;
            _cryptoProvider = cryptoProvider;
            _networkManager = networkManager;
            _appHost        = appHost;
            _imageProcessor = imageProcessor;
            _logger         = logger;

            _passwordResetProviders  = appHost.GetExports <IPasswordResetProvider>();
            _authenticationProviders = appHost.GetExports <IAuthenticationProvider>();

            _invalidAuthProvider           = _authenticationProviders.OfType <InvalidAuthProvider>().First();
            _defaultAuthenticationProvider = _authenticationProviders.OfType <DefaultAuthenticationProvider>().First();
            _defaultPasswordResetProvider  = _passwordResetProviders.OfType <DefaultPasswordResetProvider>().First();

            _users = new ConcurrentDictionary <Guid, User>();
            using var dbContext = _dbProvider.CreateContext();
            foreach (var user in dbContext.Users
                     .Include(user => user.Permissions)
                     .Include(user => user.Preferences)
                     .Include(user => user.AccessSchedules)
                     .Include(user => user.ProfileImage)
                     .AsEnumerable())
            {
                _users.Add(user.Id, user);
            }
        }
 public CloudSyncProvider(IApplicationHost appHost)
 {
     _providers = appHost.GetExports <ICloudSyncProvider>().ToArray();
 }
Exemple #5
0
 /// <summary>
 /// Creates all the plugin instances.
 /// </summary>
 public void CreatePlugins()
 {
     _ = _appHost.GetExports <IPlugin>(CreatePluginInstance);
 }
Exemple #6
0
 public void CreatePlugins()
 {
     _ = _appHost.GetExports <IPlugin>(CreatePluginInstance)
         .Where(i => i != null)
         .ToArray();
 }
Exemple #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LdapController"/> class.
 /// </summary>
 /// <param name="appHost">The application host to get the LDAP Authentication Provider from.</param>
 public LdapController(IApplicationHost appHost)
 {
     _ldapAuthenticationProvider = appHost.GetExports <LdapAuthenticationProviderPlugin>(false).First();
 }
 public void Run()
 {
     PluginConfigurationPages = _appHost.GetExports <IPluginConfigurationPage>().ToList();
 }
 public CloudSyncProvider(IApplicationHost appHost)
 {
     _providers = appHost.GetExports<ICloudSyncProvider>().ToArray();
 }
 public void Run()
 {
     Providers = _appHost.GetExports <IExtraProvider>().ToList();
 }
Exemple #11
0
        public Task RunAsync()
        {
            PluginConfigurationPages = _appHost.GetExports <IPluginConfigurationPage>().ToList();

            return(Task.CompletedTask);
        }