コード例 #1
0
 public ConnectionManager(IDlnaManager dlna, IServerConfigurationManager config, ILogger logger, IHttpClient httpClient, IXmlReaderSettingsFactory xmlReaderSettingsFactory)
     : base(logger, httpClient)
 {
     _dlna   = dlna;
     _config = config;
     _logger = logger;
     XmlReaderSettingsFactory = xmlReaderSettingsFactory;
 }
コード例 #2
0
 public SeriesMetadataService(IServerConfigurationManager serverConfigurationManager, ILogger logger, IProviderManager providerManager, IFileSystem fileSystem, IUserDataManager userDataManager, ILibraryManager libraryManager, ILocalizationManager localization, IXmlReaderSettingsFactory xmlSettings) : base(serverConfigurationManager, logger, providerManager, fileSystem, userDataManager, libraryManager)
 {
     _localization = localization;
     _xmlSettings  = xmlSettings;
 }
コード例 #3
0
 public MusicBrainzAlbumProvider(IHttpClient httpClient, IApplicationHost appHost, ILogger logger, IJsonSerializer json, IXmlReaderSettingsFactory xmlSettings)
 {
     _httpClient  = httpClient;
     _appHost     = appHost;
     _logger      = logger;
     _json        = json;
     _xmlSettings = xmlSettings;
     Current      = this;
 }
コード例 #4
0
        internal static IEnumerable <RemoteImageInfo> GetImages(string xmlPath, string preferredLanguage, int seasonNumber, IXmlReaderSettingsFactory xmlReaderSettingsFactory, IFileSystem fileSystem, CancellationToken cancellationToken)
        {
            var settings = xmlReaderSettingsFactory.Create(false);

            settings.CheckCharacters = false;
            settings.IgnoreProcessingInstructions = true;
            settings.IgnoreComments = true;

            var list = new List <RemoteImageInfo>();

            using (var fileStream = fileSystem.GetFileStream(xmlPath, FileOpenMode.Open, FileAccessMode.Read, FileShareMode.Read))
            {
                using (var streamReader = new StreamReader(fileStream, Encoding.UTF8))
                {
                    // Use XmlReader for best performance
                    using (var reader = XmlReader.Create(streamReader, settings))
                    {
                        reader.MoveToContent();
                        reader.Read();

                        // Loop through each element
                        while (!reader.EOF && reader.ReadState == ReadState.Interactive)
                        {
                            cancellationToken.ThrowIfCancellationRequested();

                            if (reader.NodeType == XmlNodeType.Element)
                            {
                                switch (reader.Name)
                                {
                                case "Banner":
                                {
                                    if (reader.IsEmptyElement)
                                    {
                                        reader.Read();
                                        continue;
                                    }
                                    using (var subtree = reader.ReadSubtree())
                                    {
                                        AddImage(subtree, list, seasonNumber);
                                    }
                                    break;
                                }

                                default:
                                    reader.Skip();
                                    break;
                                }
                            }
                            else
                            {
                                reader.Read();
                            }
                        }
                    }
                }
            }

            var isLanguageEn = string.Equals(preferredLanguage, "en", StringComparison.OrdinalIgnoreCase);

            return(list.OrderByDescending(i =>
            {
                if (string.Equals(preferredLanguage, i.Language, StringComparison.OrdinalIgnoreCase))
                {
                    return 3;
                }
                if (!isLanguageEn)
                {
                    if (string.Equals("en", i.Language, StringComparison.OrdinalIgnoreCase))
                    {
                        return 2;
                    }
                }
                if (string.IsNullOrEmpty(i.Language))
                {
                    return isLanguageEn ? 3 : 2;
                }
                return 0;
            })
                   .ThenByDescending(i => i.CommunityRating ?? 0)
                   .ThenByDescending(i => i.VoteCount ?? 0));
        }
コード例 #5
0
 public BaseVideoNfoProvider(IFileSystem fileSystem, ILogger logger, IConfigurationManager config, IProviderManager providerManager, IXmlReaderSettingsFactory xmlReaderSettingsFactory)
     : base(fileSystem)
 {
     _logger                  = logger;
     _config                  = config;
     _providerManager         = providerManager;
     XmlReaderSettingsFactory = xmlReaderSettingsFactory;
 }
コード例 #6
0
ファイル: ControlHandler.cs プロジェクト: vvuk/Emby
        public ControlHandler(ILogger logger, ILibraryManager libraryManager, DeviceProfile profile, string serverAddress, string accessToken, IImageProcessor imageProcessor, IUserDataManager userDataManager, User user, int systemUpdateId, IServerConfigurationManager config, ILocalizationManager localization, IChannelManager channelManager, IMediaSourceManager mediaSourceManager, IUserViewManager userViewManager, IMediaEncoder mediaEncoder, IXmlReaderSettingsFactory xmlReaderSettingsFactory)
            : base(config, logger, xmlReaderSettingsFactory)
        {
            _libraryManager  = libraryManager;
            _userDataManager = userDataManager;
            _user            = user;
            _systemUpdateId  = systemUpdateId;
            _channelManager  = channelManager;
            _userViewManager = userViewManager;
            _profile         = profile;
            _config          = config;

            _didlBuilder = new DidlBuilder(profile, user, imageProcessor, serverAddress, accessToken, userDataManager, localization, mediaSourceManager, Logger, libraryManager, mediaEncoder);
        }
コード例 #7
0
 public EpisodeNfoParser(ILogger logger, IConfigurationManager config, IProviderManager providerManager, IFileSystem fileSystem, IXmlReaderSettingsFactory xmlReaderSettingsFactory) : base(logger, config, providerManager, fileSystem, xmlReaderSettingsFactory)
 {
 }
コード例 #8
0
 public SeriesPostScanTask(ILibraryManager libraryManager, ILogger logger, IServerConfigurationManager config, ILocalizationManager localization, IFileSystem fileSystem, IXmlReaderSettingsFactory xmlSettings)
 {
     _libraryManager = libraryManager;
     _logger         = logger;
     _config         = config;
     _localization   = localization;
     _fileSystem     = fileSystem;
     _xmlSettings    = xmlSettings;
 }
コード例 #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TvdbPrescanTask"/> class.
 /// </summary>
 /// <param name="logger">The logger.</param>
 /// <param name="httpClient">The HTTP client.</param>
 /// <param name="config">The config.</param>
 public TvdbPrescanTask(ILogger logger, IHttpClient httpClient, IServerConfigurationManager config, IFileSystem fileSystem, ILibraryManager libraryManager, IXmlReaderSettingsFactory xmlSettings)
 {
     _logger         = logger;
     _httpClient     = httpClient;
     _config         = config;
     _fileSystem     = fileSystem;
     _libraryManager = libraryManager;
     _xmlSettings    = xmlSettings;
 }
コード例 #10
0
ファイル: FolderXmlProvider.cs プロジェクト: vvuk/Emby
 public FolderXmlProvider(IFileSystem fileSystem, ILogger logger, IProviderManager providerManager, IXmlReaderSettingsFactory xmlReaderSettingsFactory)
     : base(fileSystem)
 {
     _logger                  = logger;
     _providerManager         = providerManager;
     XmlReaderSettingsFactory = xmlReaderSettingsFactory;
 }
コード例 #11
0
 public CleanMissingEpisodesEntryPoint(ILibraryManager libraryManager, IServerConfigurationManager config, ILogger logger, ILocalizationManager localization, IFileSystem fileSystem, ITaskManager taskManager, IXmlReaderSettingsFactory xmlSettings, ITimerFactory timerFactory)
 {
     _libraryManager = libraryManager;
     _config         = config;
     _logger         = logger;
     _localization   = localization;
     _fileSystem     = fileSystem;
     _taskManager    = taskManager;
     _xmlSettings    = xmlSettings;
     _timerFactory   = timerFactory;
 }
コード例 #12
0
 public GameXmlProvider(IFileSystem fileSystem, ILogger logger, IProviderManager providerManager, IXmlReaderSettingsFactory xmlSettings)
     : base(fileSystem)
 {
     _logger          = logger;
     _providerManager = providerManager;
     _xmlSettings     = xmlSettings;
 }
コード例 #13
0
 public ControlHandler(IServerConfigurationManager config, ILogger logger, IXmlReaderSettingsFactory xmlReaderSettingsFactory, DeviceProfile profile) : base(config, logger, xmlReaderSettingsFactory)
 {
     _profile = profile;
 }
コード例 #14
0
ファイル: MissingEpisodeProvider.cs プロジェクト: ta264/Emby
 public MissingEpisodeProvider(ILogger logger, IServerConfigurationManager config, ILibraryManager libraryManager, ILocalizationManager localization, IFileSystem fileSystem, IXmlReaderSettingsFactory xmlSettings)
 {
     _logger         = logger;
     _config         = config;
     _libraryManager = libraryManager;
     _localization   = localization;
     _fileSystem     = fileSystem;
     _xmlSettings    = xmlSettings;
 }
コード例 #15
0
        public DlnaEntryPoint(IServerConfigurationManager config,
                              ILoggerFactory loggerFactory,
                              IServerApplicationHost appHost,
                              ISessionManager sessionManager,
                              IHttpClient httpClient,
                              ILibraryManager libraryManager,
                              IUserManager userManager,
                              IDlnaManager dlnaManager,
                              IImageProcessor imageProcessor,
                              IUserDataManager userDataManager,
                              ILocalizationManager localizationManager,
                              IMediaSourceManager mediaSourceManager,
                              IDeviceDiscovery deviceDiscovery,
                              IMediaEncoder mediaEncoder,
                              ISocketFactory socketFactory,
                              ITimerFactory timerFactory,
                              IEnvironmentInfo environmentInfo,
                              INetworkManager networkManager,
                              IUserViewManager userViewManager,
                              IXmlReaderSettingsFactory xmlReaderSettingsFactory,
                              ITVSeriesManager tvSeriesManager)
        {
            _config             = config;
            _appHost            = appHost;
            _sessionManager     = sessionManager;
            _httpClient         = httpClient;
            _libraryManager     = libraryManager;
            _userManager        = userManager;
            _dlnaManager        = dlnaManager;
            _imageProcessor     = imageProcessor;
            _userDataManager    = userDataManager;
            _localization       = localizationManager;
            _mediaSourceManager = mediaSourceManager;
            _deviceDiscovery    = deviceDiscovery;
            _mediaEncoder       = mediaEncoder;
            _socketFactory      = socketFactory;
            _timerFactory       = timerFactory;
            _environmentInfo    = environmentInfo;
            _networkManager     = networkManager;
            _logger             = loggerFactory.CreateLogger("Dlna");

            ContentDirectory = new ContentDirectory.ContentDirectory(dlnaManager,
                                                                     userDataManager,
                                                                     imageProcessor,
                                                                     libraryManager,
                                                                     config,
                                                                     userManager,
                                                                     _logger,
                                                                     httpClient,
                                                                     localizationManager,
                                                                     mediaSourceManager,
                                                                     userViewManager,
                                                                     mediaEncoder,
                                                                     xmlReaderSettingsFactory,
                                                                     tvSeriesManager);

            ConnectionManager = new ConnectionManager.ConnectionManager(dlnaManager, config, _logger, httpClient, xmlReaderSettingsFactory);

            MediaReceiverRegistrar = new MediaReceiverRegistrar.MediaReceiverRegistrar(_logger, httpClient, config, xmlReaderSettingsFactory);
            Current = this;
        }
コード例 #16
0
 public ContentDirectory(IDlnaManager dlna,
                         IUserDataManager userDataManager,
                         IImageProcessor imageProcessor,
                         ILibraryManager libraryManager,
                         IServerConfigurationManager config,
                         IUserManager userManager,
                         ILogger logger,
                         IHttpClient httpClient, ILocalizationManager localization, IChannelManager channelManager, IMediaSourceManager mediaSourceManager, IUserViewManager userViewManager, Func <IMediaEncoder> mediaEncoder, IXmlReaderSettingsFactory xmlReaderSettingsFactory, ITVSeriesManager tvSeriesManager)
     : base(logger, httpClient)
 {
     _dlna                    = dlna;
     _userDataManager         = userDataManager;
     _imageProcessor          = imageProcessor;
     _libraryManager          = libraryManager;
     _config                  = config;
     _userManager             = userManager;
     _localization            = localization;
     _channelManager          = channelManager;
     _mediaSourceManager      = mediaSourceManager;
     _userViewManager         = userViewManager;
     _mediaEncoder            = mediaEncoder;
     XmlReaderSettingsFactory = xmlReaderSettingsFactory;
     _tvSeriesManager         = tvSeriesManager;
 }
コード例 #17
0
 public BaseXmlSaver(IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILogger logger, IXmlReaderSettingsFactory xmlReaderSettingsFactory)
 {
     FileSystem           = fileSystem;
     ConfigurationManager = configurationManager;
     LibraryManager       = libraryManager;
     UserManager          = userManager;
     UserDataManager      = userDataManager;
     Logger = logger;
     XmlReaderSettingsFactory = xmlReaderSettingsFactory;
 }
コード例 #18
0
 public MediaReceiverRegistrar(ILogger logger, IHttpClient httpClient, IServerConfigurationManager config, IXmlReaderSettingsFactory xmlReaderSettingsFactory)
     : base(logger, httpClient)
 {
     _config = config;
     XmlReaderSettingsFactory = xmlReaderSettingsFactory;
 }
コード例 #19
0
 protected BaseNfoSaver(IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILogger logger, IXmlReaderSettingsFactory xmlReaderSettingsFactory)
 {
     Logger = logger;
     XmlReaderSettingsFactory = xmlReaderSettingsFactory;
     UserDataManager          = userDataManager;
     UserManager          = userManager;
     LibraryManager       = libraryManager;
     ConfigurationManager = configurationManager;
     FileSystem           = fileSystem;
 }
コード例 #20
0
 public BoxSetXmlParser(ILogger logger, IProviderManager providerManager, IXmlReaderSettingsFactory xmlReaderSettingsFactory, IFileSystem fileSystem) : base(logger, providerManager, xmlReaderSettingsFactory, fileSystem)
 {
 }
コード例 #21
0
 public TvdbSeasonImageProvider(IServerConfigurationManager config, IHttpClient httpClient, IFileSystem fileSystem, IXmlReaderSettingsFactory xmlSettings)
 {
     _config      = config;
     _httpClient  = httpClient;
     _fileSystem  = fileSystem;
     _xmlSettings = xmlSettings;
 }
コード例 #22
0
 public VideoNfoProvider(IFileSystem fileSystem, ILogger logger, IConfigurationManager config, IProviderManager providerManager, IXmlReaderSettingsFactory xmlReaderSettingsFactory) : base(fileSystem, logger, config, providerManager, xmlReaderSettingsFactory)
 {
 }
コード例 #23
0
 public MusicBrainzArtistProvider(IXmlReaderSettingsFactory xmlSettings)
 {
     _xmlSettings = xmlSettings;
 }
コード例 #24
0
 protected BaseControlHandler(IServerConfigurationManager config, ILogger logger, IXmlReaderSettingsFactory xmlReaderSettingsFactory)
 {
     Config = config;
     Logger = logger;
     XmlReaderSettingsFactory = xmlReaderSettingsFactory;
 }
コード例 #25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BaseNfoParser{T}" /> class.
 /// </summary>
 public BaseNfoParser(ILogger logger, IConfigurationManager config, IProviderManager providerManager, IFileSystem fileSystem, IXmlReaderSettingsFactory xmlReaderSettingsFactory)
 {
     Logger                   = logger;
     _config                  = config;
     ProviderManager          = providerManager;
     FileSystem               = fileSystem;
     XmlReaderSettingsFactory = xmlReaderSettingsFactory;
 }
コード例 #26
0
 public TvdbEpisodeProvider(IFileSystem fileSystem, IServerConfigurationManager config, IHttpClient httpClient, ILogger logger, IXmlReaderSettingsFactory xmlSettings)
 {
     _fileSystem  = fileSystem;
     _config      = config;
     _httpClient  = httpClient;
     _logger      = logger;
     _xmlSettings = xmlSettings;
     Current      = this;
 }
コード例 #27
0
 public MusicVideoXmlProvider(IFileSystem fileSystem, ILogger logger, IProviderManager providerManager, IXmlReaderSettingsFactory xmlReaderSettingsFactory)
     : base(fileSystem, logger)
 {
     _providerManager         = providerManager;
     XmlReaderSettingsFactory = xmlReaderSettingsFactory;
 }
コード例 #28
0
ファイル: EpisodeXmlParser.cs プロジェクト: vvuk/Emby
 public EpisodeXmlParser(ILogger logger, IFileSystem fileSystem, IProviderManager providerManager, IXmlReaderSettingsFactory xmlSettings)
     : base(logger, providerManager, xmlSettings, fileSystem)
 {
     _fileSystem = fileSystem;
 }
コード例 #29
0
ファイル: GameXmlSaver.cs プロジェクト: yester/Emby
 public GameXmlSaver(IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILogger logger, IXmlReaderSettingsFactory xmlReaderSettingsFactory) : base(fileSystem, configurationManager, libraryManager, userManager, userDataManager, logger, xmlReaderSettingsFactory)
 {
 }
コード例 #30
0
 public ControlHandler(IServerConfigurationManager config, ILogger logger, IXmlReaderSettingsFactory xmlReaderSettingsFactory) : base(config, logger, xmlReaderSettingsFactory)
 {
 }