/// <summary>
 /// Initializes a new instance of the <see cref="ConnectionManagerService"/> class.
 /// </summary>
 /// <param name="dlnaServerManager">The <see cref="IDlnaServerManager"/> instance.</param>
 /// <param name="dlna">The <see cref="IDlnaProfileManager"/> for use with the <see cref="ConnectionManagerService"/> instance.</param>
 /// <param name="logger">The <see cref="ILogger"/> for use with the <see cref="ConnectionManagerService"/> instance.</param>
 /// <param name="httpClientFactory">The <see cref="IHttpClientFactory"/> for use with the <see cref="ConnectionManagerService"/> instance.</param>
 public ConnectionManagerService(
     IDlnaServerManager dlnaServerManager,
     IDlnaProfileManager dlna,
     ILogger logger,
     IHttpClientFactory httpClientFactory)
     : base(dlnaServerManager, logger, httpClientFactory)
     => _dlna = dlna;
 /// <summary>
 /// Initializes a new instance of the <see cref="ContentDirectoryService"/> class.
 /// </summary>
 /// <param name="dlnaServerManager">The <see cref="IDlnaServerManager"/> to use in the <see cref="ContentDirectoryService"/> instance.</param>
 /// <param name="dlna">The <see cref="IDlnaProfileManager"/> to use in the <see cref="ContentDirectoryService"/> instance.</param>
 /// <param name="userDataManager">The <see cref="IUserDataManager"/> to use in the <see cref="ContentDirectoryService"/> instance.</param>
 /// <param name="imageProcessor">The <see cref="IImageProcessor"/> to use in the <see cref="ContentDirectoryService"/> instance.</param>
 /// <param name="libraryManager">The <see cref="ILibraryManager"/> to use in the <see cref="ContentDirectoryService"/> instance.</param>
 /// <param name="userManager">The <see cref="IUserManager"/> to use in the <see cref="ContentDirectoryService"/> instance.</param>
 /// <param name="logger">The <see cref="ILogger"/> to use in the <see cref="ContentDirectoryService"/> instance.</param>
 /// <param name="httpClient">The <see cref="IHttpClientFactory"/> to use in the <see cref="ContentDirectoryService"/> instance.</param>
 /// <param name="localization">The <see cref="ILocalizationManager"/> to use in the <see cref="ContentDirectoryService"/> instance.</param>
 /// <param name="mediaSourceManager">The <see cref="IMediaSourceManager"/> to use in the <see cref="ContentDirectoryService"/> instance.</param>
 /// <param name="userViewManager">The <see cref="IUserViewManager"/> to use in the <see cref="ContentDirectoryService"/> instance.</param>
 /// <param name="mediaEncoder">The <see cref="IMediaEncoder"/> to use in the <see cref="ContentDirectoryService"/> instance.</param>
 /// <param name="tvSeriesManager">The <see cref="ITVSeriesManager"/> to use in the <see cref="ContentDirectoryService"/> instance.</param>
 public ContentDirectoryService(
     IDlnaServerManager dlnaServerManager,
     IDlnaProfileManager dlna,
     IUserDataManager userDataManager,
     IImageProcessor imageProcessor,
     ILibraryManager libraryManager,
     IUserManager userManager,
     ILogger logger,
     IHttpClientFactory httpClient,
     ILocalizationManager localization,
     IMediaSourceManager mediaSourceManager,
     IUserViewManager userViewManager,
     IMediaEncoder mediaEncoder,
     ITVSeriesManager tvSeriesManager)
     : base(dlnaServerManager, logger, httpClient)
 {
     _dlna               = dlna;
     _userDataManager    = userDataManager;
     _imageProcessor     = imageProcessor;
     _libraryManager     = libraryManager;
     _userManager        = userManager;
     _localization       = localization;
     _mediaSourceManager = mediaSourceManager;
     _userViewManager    = userViewManager;
     _mediaEncoder       = mediaEncoder;
     _tvSeriesManager    = tvSeriesManager;
 }
Exemple #3
0
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. : ServerString is auto set by property.
        public DlnaServerManager(
            ILoggerFactory loggerFactory,
            IServerApplicationHost appHost,
            IHttpClientFactory httpClientFactory,
            ILibraryManager libraryManager,
            IUserManager userManager,
            IDlnaProfileManager dlnaProfileManager,
            IImageProcessor imageProcessor,
            IUserDataManager userDataManager,
            ILocalizationManager localizationManager,
            IMediaSourceManager mediaSourceManager,
            IMediaEncoder mediaEncoder,
            INetworkManager networkManager,
            IUserViewManager userViewManager,
            ITVSeriesManager tvSeriesManager,
            IConfigurationManager configuration,
            IApplicationPaths applicationPaths,
            IXmlSerializer xmlSerializer)
            : base(applicationPaths, xmlSerializer)
        {
            _networkManager       = networkManager;
            _appHost              = appHost;
            _logger               = loggerFactory.CreateLogger <DlnaServerManager>();
            _netConfig            = (NetworkConfiguration)configuration.GetConfiguration("network");
            _configurationManager = configuration;
            // Link into the streaming API, so that headers etc can be performed.
            StreamingHelpers.StreamEvent ??= DlnaStreamHelper.StreamEventProcessor;

            _logger.LogDebug("DLNA Server : Starting Content Directory service.");
            ContentDirectory = new ContentDirectoryService(
                this,
                dlnaProfileManager,
                userDataManager,
                imageProcessor,
                libraryManager,
                userManager,
                _logger,
                httpClientFactory,
                localizationManager,
                mediaSourceManager,
                userViewManager,
                mediaEncoder,
                tvSeriesManager);

            ServerId = Guid.NewGuid();
            _logger.LogDebug("DLNA Server : Starting Connection Manager service.");
            ConnectionManager = new ConnectionManagerService(this, dlnaProfileManager, _logger, httpClientFactory);

            if (Configuration.EnableMsMediaReceiverRegistrar)
            {
                _logger.LogDebug("DLNA Server : Starting Media Receiver Registrar service.");
                MediaReceiverRegistrar = new MediaReceiverRegistrarService(this, _logger, httpClientFactory);
            }

            _logger.LogDebug("DLNA Server : Starting DLNA advertisements.");
            _publisher = new SsdpServerPublisher(this, configuration, _logger, loggerFactory, _networkManager);

            // Update from ssdp.xml
            Configuration.CopyProperties(SsdpServer.Instance.Configuration);
            SaveConfiguration();

            _configurationManager.NamedConfigurationUpdating += SyncWithSsdp;
            ConfigurationChanged += SyncWithSsdp;
        }