Esempio n. 1
0
        /// <summary>
        /// Instantiates a new <see cref="NfoSeriesMetadataExtractor"/> object
        /// </summary>
        public StubSeriesMetadataExtractor()
        {
            // The metadataExtractorPriority is intentionally set wrong to "Extended" although, depending on the
            // content of the nfo-file, it may download thumbs from the internet (and should therefore be
            // "External"). This is a temporary workaround for performance purposes. It ensures that this
            // MetadataExtractor is applied before the VideoThumbnailer (which is intentionally set to "External"
            // although it only uses local files). Creating thumbs with the VideoThumbnailer takes much longer
            // than downloading them from the internet.
            // ToDo: Correct this once we have a better priority system
            _metadata = new MetadataExtractorMetadata(
                metadataExtractorId: METADATAEXTRACTOR_ID,
                name: "Stub series metadata extractor",
                metadataExtractorPriority: MetadataExtractorPriority.Stub,
                processesNonFiles: true,
                shareCategories: MEDIA_CATEGORIES,
                extractedAspectTypes: new MediaItemAspectMetadata[]
            {
                MediaAspect.Metadata,
                EpisodeAspect.Metadata,
                StubAspect.Metadata
            });

            _settings = ServiceRegistration.Get <ISettingsManager>().Load <StubSeriesMetadataExtractorSettings>();

            if (_settings.EnableDebugLogging)
            {
                _debugLogger = FileLogger.CreateFileLogger(ServiceRegistration.Get <IPathManager>().GetPath(@"<LOG>\StubSeriesMetadataExtractorDebug.log"), LogLevel.Debug, false, true);
                LogSettings();
            }
            else
            {
                _debugLogger = new NoLogger();
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Instantiates a <see cref="StubSeriesReader"/> object
 /// </summary>
 /// <param name="debugLogger">Debug logger to log to</param>
 /// <param name="miNumber">Unique number of the MediaItem for which the stub-file is parsed</param>
 /// <param name="importOnly">If true, no long lasting operations such as parsing images are performed</param>
 /// <param name="httpClient"><see cref="HttpClient"/> used to download from http URLs contained in stub-files</param>
 /// <param name="settings">Settings of the <see cref="StubSeriesMetadataExtractor"/></param>
 public StubSeriesReader(ILogger debugLogger, long miNumber, bool importOnly, StubSeriesMetadataExtractorSettings settings)
     : base(debugLogger, miNumber, importOnly, settings)
 {
     InitializeSupportedElements();
 }