| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 | using System.Collections.Generic;using System.IO;using MediaBrowser.Controller.Configuration;using MediaBrowser.Controller.Entities;using MediaBrowser.Controller.Entities.Audio;using MediaBrowser.Controller.Providers;using MediaBrowser.Model.IO;namespace MediaBrowser.LocalMetadata.Images{    public class InternalMetadataFolderImageProvider : ILocalImageFileProvider, IHasOrder    {        private readonly IServerConfigurationManager _config;        private readonly IFileSystem _fileSystem;        public InternalMetadataFolderImageProvider(IServerConfigurationManager config, IFileSystem fileSystem)        {            _config = config;            _fileSystem = fileSystem;        }        public string Name => "Internal Images";        public bool Supports(BaseItem item)        {            if (item is Photo)            {                return false;            }            if (!item.IsSaveLocalMetadataEnabled())            {                return true;            }            // Extracted images will be saved in here            if (item is Audio)            {                return true;            }            if (item.SupportsLocalMetadata && !item.AlwaysScanInternalMetadataPath)            {                return false;            }            return true;        }        // Make sure this is last so that all other locations are scanned first        public int Order => 1000;        public List<LocalImageInfo> GetImages(BaseItem item, IDirectoryService directoryService)        {            var path = item.GetInternalMetadataPath();            try            {                return new LocalImageProvider(_fileSystem).GetImages(item, path, false, directoryService);            }            catch (IOException)            {                return new List<LocalImageInfo>();            }        }    }}
 |