예제 #1
0
 public FFProbeProvider(
     ILogger <FFProbeProvider> logger,
     IMediaSourceManager mediaSourceManager,
     IMediaEncoder mediaEncoder,
     IItemRepository itemRepo,
     IBlurayExaminer blurayExaminer,
     ILocalizationManager localization,
     IEncodingManager encodingManager,
     IServerConfigurationManager config,
     ISubtitleManager subtitleManager,
     IChapterManager chapterManager,
     ILibraryManager libraryManager,
     IFileSystem fileSystem,
     NamingOptions namingOptions)
 {
     _logger           = logger;
     _audioResolver    = new AudioResolver(localization, mediaEncoder, fileSystem, namingOptions);
     _subtitleResolver = new SubtitleResolver(localization, mediaEncoder, fileSystem, namingOptions);
     _videoProber      = new FFProbeVideoInfo(
         _logger,
         mediaSourceManager,
         mediaEncoder,
         itemRepo,
         blurayExaminer,
         localization,
         encodingManager,
         config,
         subtitleManager,
         chapterManager,
         libraryManager,
         _audioResolver,
         _subtitleResolver);
     _audioProber = new FFProbeAudioInfo(mediaSourceManager, mediaEncoder, itemRepo, libraryManager);
 }
예제 #2
0
        public Task <ItemUpdateType> FetchVideoInfo <T>(T item, MetadataRefreshOptions options, CancellationToken cancellationToken)
            where T : Video
        {
            if (item.LocationType != LocationType.FileSystem)
            {
                return(_cachedTask);
            }

            if (item.VideoType == VideoType.Iso && !_isoManager.CanMount(item.Path))
            {
                return(_cachedTask);
            }

            if (item.VideoType == VideoType.HdDvd)
            {
                return(_cachedTask);
            }

            if (item.IsPlaceHolder)
            {
                return(_cachedTask);
            }

            var prober = new FFProbeVideoInfo(_logger, _isoManager, _mediaEncoder, _itemRepo, _blurayExaminer, _localization, _appPaths, _json, _encodingManager, _fileSystem, _config, _subtitleManager, _chapterManager);

            return(prober.ProbeVideo(item, options, cancellationToken));
        }
예제 #3
0
        public Task <ItemUpdateType> FetchVideoInfo <T>(T item, IDirectoryService directoryService, CancellationToken cancellationToken)
            where T : Video
        {
            if (item.LocationType != LocationType.FileSystem)
            {
                return(_cachedTask);
            }

            if (item.VideoType == VideoType.Iso && !_isoManager.CanMount(item.Path))
            {
                return(_cachedTask);
            }

            if (item.VideoType == VideoType.HdDvd)
            {
                return(_cachedTask);
            }

            if (item.IsPlaceHolder)
            {
                return(_cachedTask);
            }

            var prober = new FFProbeVideoInfo(_logger, _isoManager, _mediaEncoder, _itemRepo, _blurayExaminer, _localization, _appPaths, _json, _encodingManager);

            return(prober.ProbeVideo(item, directoryService, cancellationToken));
        }
예제 #4
0
        public Task <ItemUpdateType> FetchVideoInfo <T>(T item, MetadataRefreshOptions options, CancellationToken cancellationToken)
            where T : Video
        {
            if (item.VideoType == VideoType.Iso)
            {
                return(_cachedTask);
            }

            if (item.IsPlaceHolder)
            {
                return(_cachedTask);
            }

            if (!item.IsCompleteMedia)
            {
                return(_cachedTask);
            }

            if (item.IsVirtualItem)
            {
                return(_cachedTask);
            }

            if (!options.EnableRemoteContentProbe && !item.IsFileProtocol)
            {
                return(_cachedTask);
            }

            if (item.IsShortcut)
            {
                FetchShortcutInfo(item);
            }

            var prober = new FFProbeVideoInfo(
                _logger,
                _mediaSourceManager,
                _mediaEncoder,
                _itemRepo,
                _blurayExaminer,
                _localization,
                _encodingManager,
                _fileSystem,
                _config,
                _subtitleManager,
                _chapterManager,
                _libraryManager);

            return(prober.ProbeVideo(item, options, cancellationToken));
        }
예제 #5
0
        public bool HasChanged(IHasMetadata item, IDirectoryService directoryService, DateTime date)
        {
            if (item.DateModified > date)
            {
                return(true);
            }

            if (item.SupportsLocalMetadata)
            {
                var video = item as Video;

                if (video != null && !video.IsPlaceHolder)
                {
                    var prober = new FFProbeVideoInfo(_logger, _isoManager, _mediaEncoder, _itemRepo, _blurayExaminer, _localization, _appPaths, _json, _encodingManager);

                    return(!video.SubtitleFiles.SequenceEqual(prober.GetSubtitleFiles(video, directoryService).Select(i => i.FullName).OrderBy(i => i), StringComparer.OrdinalIgnoreCase));
                }
            }

            return(false);
        }
예제 #6
0
        public Task <ItemUpdateType> FetchVideoInfo <T>(T item, MetadataRefreshOptions options, CancellationToken cancellationToken)
            where T : Video
        {
            if (item.VideoType == VideoType.Iso)
            {
                return(_cachedTask);
            }

            if (item.IsPlaceHolder)
            {
                return(_cachedTask);
            }

            if (!item.IsCompleteMedia)
            {
                return(_cachedTask);
            }

            if (item.IsVirtualItem)
            {
                return(_cachedTask);
            }

            // hack alert
            if (item.SourceType == SourceType.Channel && !_channelManager.EnableMediaProbe(item))
            {
                return(_cachedTask);
            }

            if (item.IsShortcut)
            {
                FetchShortcutInfo(item);
            }

            var prober = new FFProbeVideoInfo(_logger, _isoManager, _mediaEncoder, _itemRepo, _blurayExaminer, _localization, _appPaths, _json, _encodingManager, _fileSystem, _config, _subtitleManager, _chapterManager, _libraryManager);

            return(prober.ProbeVideo(item, options, cancellationToken));
        }