From bd4ffa898ec6afb0f700d42bb3d04e5eb4b2cd1d Mon Sep 17 00:00:00 2001 From: softworkz Date: Sat, 27 Aug 2016 06:33:18 +0200 Subject: [PATCH] Programmatic provider id handling for xml and nfo persistence --- .../Providers/BaseItemXmlParser.cs | 157 ++++-------------- .../Parsers/BoxSetXmlParser.cs | 4 +- .../Parsers/EpisodeXmlParser.cs | 4 +- .../Parsers/GameSystemXmlParser.cs | 4 +- .../Parsers/GameXmlParser.cs | 4 +- .../Parsers/MovieXmlParser.cs | 10 +- .../Parsers/MusicVideoXmlParser.cs | 4 +- .../Parsers/PlaylistXmlParser.cs | 4 +- .../Parsers/SeasonXmlParser.cs | 4 +- .../Parsers/SeriesXmlParser.cs | 4 +- .../Providers/BoxSetXmlProvider.cs | 6 +- .../Providers/EpisodeXmlProvider.cs | 6 +- .../Providers/FolderXmlProvider.cs | 6 +- .../Providers/GameSystemXmlProvider.cs | 6 +- .../Providers/GameXmlProvider.cs | 6 +- .../Providers/MovieXmlProvider.cs | 6 +- .../Providers/MusicVideoXmlProvider.cs | 6 +- .../Providers/PersonXmlProvider.cs | 6 +- .../Providers/PlaylistXmlProvider.cs | 6 +- .../Providers/SeasonXmlProvider.cs | 6 +- .../Providers/SeriesXmlProvider.cs | 6 +- .../Providers/VideoXmlProvider.cs | 6 +- .../Savers/XmlSaverHelpers.cs | 121 +------------- .../Parsers/BaseNfoParser.cs | 152 +++-------------- .../Parsers/EpisodeNfoParser.cs | 2 +- .../Parsers/MovieNfoParser.cs | 4 +- .../Parsers/SeasonNfoParser.cs | 2 +- .../Parsers/SeriesNfoParser.cs | 2 +- .../Providers/AlbumNfoProvider.cs | 6 +- .../Providers/ArtistNfoProvider.cs | 6 +- .../Providers/BaseVideoNfoProvider.cs | 6 +- .../Providers/EpisodeNfoProvider.cs | 6 +- .../Providers/MovieNfoProvider.cs | 7 +- .../Providers/SeasonNfoProvider.cs | 6 +- .../Providers/SeriesNfoProvider.cs | 6 +- .../Savers/BaseNfoSaver.cs | 33 +++- MediaBrowser.sln | 5 +- 37 files changed, 196 insertions(+), 439 deletions(-) diff --git a/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs b/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs index 75da3b67a..4484adb1d 100644 --- a/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs +++ b/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs @@ -23,14 +23,18 @@ namespace MediaBrowser.Controller.Providers /// The logger /// protected ILogger Logger { get; private set; } + protected IProviderManager ProviderManager { get; private set; } + + private Dictionary _validProviderIds; /// /// Initializes a new instance of the class. /// /// The logger. - public BaseItemXmlParser(ILogger logger) + public BaseItemXmlParser(ILogger logger, IProviderManager providerManager) { Logger = logger; + ProviderManager = providerManager; } /// @@ -60,6 +64,22 @@ namespace MediaBrowser.Controller.Providers ValidationType = ValidationType.None }; + _validProviderIds = _validProviderIds = new Dictionary(StringComparer.InvariantCultureIgnoreCase); + + var idInfos = ProviderManager.GetExternalIdInfos(item.Item); + + foreach (var info in idInfos) + { + var id = info.Key + "Id"; + if (!_validProviderIds.ContainsKey(id)) + { + _validProviderIds.Add(id, info.Key); + } + } + + //Additional Mappings + _validProviderIds.Add("IMDB", "Imdb"); + //Fetch(item, metadataFile, settings, Encoding.GetEncoding("ISO-8859-1"), cancellationToken); Fetch(item, metadataFile, settings, Encoding.UTF8, cancellationToken); } @@ -657,14 +677,6 @@ namespace MediaBrowser.Controller.Providers break; } - case "TvDbId": - var tvdbId = reader.ReadElementContentAsString(); - if (!string.IsNullOrWhiteSpace(tvdbId)) - { - item.SetProviderId(MetadataProviders.Tvdb, tvdbId); - } - break; - case "VoteCount": { var val = reader.ReadElementContentAsString(); @@ -679,95 +691,6 @@ namespace MediaBrowser.Controller.Providers } break; } - case "MusicBrainzAlbumId": - { - var mbz = reader.ReadElementContentAsString(); - if (!string.IsNullOrWhiteSpace(mbz)) - { - item.SetProviderId(MetadataProviders.MusicBrainzAlbum, mbz); - } - break; - } - case "MusicBrainzAlbumArtistId": - { - var mbz = reader.ReadElementContentAsString(); - if (!string.IsNullOrWhiteSpace(mbz)) - { - item.SetProviderId(MetadataProviders.MusicBrainzAlbumArtist, mbz); - } - break; - } - case "MusicBrainzArtistId": - { - var mbz = reader.ReadElementContentAsString(); - if (!string.IsNullOrWhiteSpace(mbz)) - { - item.SetProviderId(MetadataProviders.MusicBrainzArtist, mbz); - } - break; - } - case "MusicBrainzReleaseGroupId": - { - var mbz = reader.ReadElementContentAsString(); - if (!string.IsNullOrWhiteSpace(mbz)) - { - item.SetProviderId(MetadataProviders.MusicBrainzReleaseGroup, mbz); - } - break; - } - case "TVRageId": - { - var id = reader.ReadElementContentAsString(); - if (!string.IsNullOrWhiteSpace(id)) - { - item.SetProviderId(MetadataProviders.TvRage, id); - } - break; - } - case "TvMazeId": - { - var id = reader.ReadElementContentAsString(); - if (!string.IsNullOrWhiteSpace(id)) - { - item.SetProviderId(MetadataProviders.TvMaze, id); - } - break; - } - case "AudioDbArtistId": - { - var id = reader.ReadElementContentAsString(); - if (!string.IsNullOrWhiteSpace(id)) - { - item.SetProviderId(MetadataProviders.AudioDbArtist, id); - } - break; - } - case "AudioDbAlbumId": - { - var id = reader.ReadElementContentAsString(); - if (!string.IsNullOrWhiteSpace(id)) - { - item.SetProviderId(MetadataProviders.AudioDbAlbum, id); - } - break; - } - case "RottenTomatoesId": - var rtId = reader.ReadElementContentAsString(); - if (!string.IsNullOrWhiteSpace(rtId)) - { - item.SetProviderId(MetadataProviders.RottenTomatoes, rtId); - } - break; - - case "TMDbId": - var tmdb = reader.ReadElementContentAsString(); - if (!string.IsNullOrWhiteSpace(tmdb)) - { - item.SetProviderId(MetadataProviders.Tmdb, tmdb); - } - break; - - case "TMDbCollectionId": case "CollectionNumber": var tmdbCollection = reader.ReadElementContentAsString(); if (!string.IsNullOrWhiteSpace(tmdbCollection)) @@ -776,30 +699,6 @@ namespace MediaBrowser.Controller.Providers } break; - case "TVcomId": - var TVcomId = reader.ReadElementContentAsString(); - if (!string.IsNullOrWhiteSpace(TVcomId)) - { - item.SetProviderId(MetadataProviders.Tvcom, TVcomId); - } - break; - - case "Zap2ItId": - var zap2ItId = reader.ReadElementContentAsString(); - if (!string.IsNullOrWhiteSpace(zap2ItId)) - { - item.SetProviderId(MetadataProviders.Zap2It, zap2ItId); - } - break; - - case "IMDB": - var imDbId = reader.ReadElementContentAsString(); - if (!string.IsNullOrWhiteSpace(imDbId)) - { - item.SetProviderId(MetadataProviders.Imdb, imDbId); - } - break; - case "Genres": { using (var subtree = reader.ReadSubtree()) @@ -891,7 +790,19 @@ namespace MediaBrowser.Controller.Providers } default: - reader.Skip(); + if (_validProviderIds.ContainsKey(reader.Name)) + { + var id = reader.ReadElementContentAsString(); + if (!string.IsNullOrWhiteSpace(id)) + { + item.SetProviderId(_validProviderIds[reader.Name], id); + } + } + else + { + reader.Skip(); + } + break; } } diff --git a/MediaBrowser.LocalMetadata/Parsers/BoxSetXmlParser.cs b/MediaBrowser.LocalMetadata/Parsers/BoxSetXmlParser.cs index 772af0673..9ebb357c6 100644 --- a/MediaBrowser.LocalMetadata/Parsers/BoxSetXmlParser.cs +++ b/MediaBrowser.LocalMetadata/Parsers/BoxSetXmlParser.cs @@ -9,8 +9,8 @@ namespace MediaBrowser.LocalMetadata.Parsers { public class BoxSetXmlParser : BaseItemXmlParser { - public BoxSetXmlParser(ILogger logger) - : base(logger) + public BoxSetXmlParser(ILogger logger, IProviderManager providerManager) + : base(logger, providerManager) { } diff --git a/MediaBrowser.LocalMetadata/Parsers/EpisodeXmlParser.cs b/MediaBrowser.LocalMetadata/Parsers/EpisodeXmlParser.cs index d2ef01465..71f6d3fe9 100644 --- a/MediaBrowser.LocalMetadata/Parsers/EpisodeXmlParser.cs +++ b/MediaBrowser.LocalMetadata/Parsers/EpisodeXmlParser.cs @@ -20,8 +20,8 @@ namespace MediaBrowser.LocalMetadata.Parsers private List _imagesFound; private readonly IFileSystem _fileSystem; - public EpisodeXmlParser(ILogger logger, IFileSystem fileSystem) - : base(logger) + public EpisodeXmlParser(ILogger logger, IFileSystem fileSystem, IProviderManager providerManager) + : base(logger, providerManager) { _fileSystem = fileSystem; } diff --git a/MediaBrowser.LocalMetadata/Parsers/GameSystemXmlParser.cs b/MediaBrowser.LocalMetadata/Parsers/GameSystemXmlParser.cs index 09cc1fdd7..75df53958 100644 --- a/MediaBrowser.LocalMetadata/Parsers/GameSystemXmlParser.cs +++ b/MediaBrowser.LocalMetadata/Parsers/GameSystemXmlParser.cs @@ -10,8 +10,8 @@ namespace MediaBrowser.LocalMetadata.Parsers { public class GameSystemXmlParser : BaseItemXmlParser { - public GameSystemXmlParser(ILogger logger) - : base(logger) + public GameSystemXmlParser(ILogger logger, IProviderManager providerManager) + : base(logger, providerManager) { } diff --git a/MediaBrowser.LocalMetadata/Parsers/GameXmlParser.cs b/MediaBrowser.LocalMetadata/Parsers/GameXmlParser.cs index 4bfcae44f..956b8baef 100644 --- a/MediaBrowser.LocalMetadata/Parsers/GameXmlParser.cs +++ b/MediaBrowser.LocalMetadata/Parsers/GameXmlParser.cs @@ -16,8 +16,8 @@ namespace MediaBrowser.LocalMetadata.Parsers { private readonly CultureInfo _usCulture = new CultureInfo("en-US"); - public GameXmlParser(ILogger logger) - : base(logger) + public GameXmlParser(ILogger logger, IProviderManager providerManager) + : base(logger, providerManager) { } diff --git a/MediaBrowser.LocalMetadata/Parsers/MovieXmlParser.cs b/MediaBrowser.LocalMetadata/Parsers/MovieXmlParser.cs index 1c1bbe71e..6e78d365e 100644 --- a/MediaBrowser.LocalMetadata/Parsers/MovieXmlParser.cs +++ b/MediaBrowser.LocalMetadata/Parsers/MovieXmlParser.cs @@ -12,8 +12,8 @@ namespace MediaBrowser.LocalMetadata.Parsers public class BaseVideoXmlParser : BaseItemXmlParser where T : Video { - public BaseVideoXmlParser(ILogger logger) - : base(logger) + public BaseVideoXmlParser(ILogger logger, IProviderManager providerManager) + : base(logger, providerManager) { } @@ -50,15 +50,15 @@ namespace MediaBrowser.LocalMetadata.Parsers public class MovieXmlParser : BaseVideoXmlParser { - public MovieXmlParser(ILogger logger) : base(logger) + public MovieXmlParser(ILogger logger, IProviderManager providerManager) : base(logger, providerManager) { } } public class VideoXmlParser : BaseVideoXmlParser /// The logger. - public MusicVideoXmlParser(ILogger logger) - : base(logger) + public MusicVideoXmlParser(ILogger logger, IProviderManager providerManager) + : base(logger, providerManager) { } diff --git a/MediaBrowser.LocalMetadata/Parsers/PlaylistXmlParser.cs b/MediaBrowser.LocalMetadata/Parsers/PlaylistXmlParser.cs index d4552fe12..de46c0a86 100644 --- a/MediaBrowser.LocalMetadata/Parsers/PlaylistXmlParser.cs +++ b/MediaBrowser.LocalMetadata/Parsers/PlaylistXmlParser.cs @@ -11,8 +11,8 @@ namespace MediaBrowser.LocalMetadata.Parsers { public class PlaylistXmlParser : BaseItemXmlParser { - public PlaylistXmlParser(ILogger logger) - : base(logger) + public PlaylistXmlParser(ILogger logger, IProviderManager providerManager) + : base(logger, providerManager) { } diff --git a/MediaBrowser.LocalMetadata/Parsers/SeasonXmlParser.cs b/MediaBrowser.LocalMetadata/Parsers/SeasonXmlParser.cs index 7fd60d3f7..9769ffc72 100644 --- a/MediaBrowser.LocalMetadata/Parsers/SeasonXmlParser.cs +++ b/MediaBrowser.LocalMetadata/Parsers/SeasonXmlParser.cs @@ -7,8 +7,8 @@ namespace MediaBrowser.LocalMetadata.Parsers { public class SeasonXmlParser : BaseItemXmlParser { - public SeasonXmlParser(ILogger logger) - : base(logger) + public SeasonXmlParser(ILogger logger, IProviderManager providerManager) + : base(logger, providerManager) { } diff --git a/MediaBrowser.LocalMetadata/Parsers/SeriesXmlParser.cs b/MediaBrowser.LocalMetadata/Parsers/SeriesXmlParser.cs index 8133bd9fe..7b7fb4751 100644 --- a/MediaBrowser.LocalMetadata/Parsers/SeriesXmlParser.cs +++ b/MediaBrowser.LocalMetadata/Parsers/SeriesXmlParser.cs @@ -17,8 +17,8 @@ namespace MediaBrowser.LocalMetadata.Parsers /// Initializes a new instance of the class. /// /// The logger. - public SeriesXmlParser(ILogger logger) - : base(logger) + public SeriesXmlParser(ILogger logger, IProviderManager providerManager) + : base(logger, providerManager) { } diff --git a/MediaBrowser.LocalMetadata/Providers/BoxSetXmlProvider.cs b/MediaBrowser.LocalMetadata/Providers/BoxSetXmlProvider.cs index 217a5f355..3acb2b74c 100644 --- a/MediaBrowser.LocalMetadata/Providers/BoxSetXmlProvider.cs +++ b/MediaBrowser.LocalMetadata/Providers/BoxSetXmlProvider.cs @@ -14,16 +14,18 @@ namespace MediaBrowser.LocalMetadata.Providers public class BoxSetXmlProvider : BaseXmlProvider { private readonly ILogger _logger; + private readonly IProviderManager _providerManager; - public BoxSetXmlProvider(IFileSystem fileSystem, ILogger logger) + public BoxSetXmlProvider(IFileSystem fileSystem, ILogger logger, IProviderManager providerManager) : base(fileSystem) { _logger = logger; + _providerManager = providerManager; } protected override void Fetch(MetadataResult result, string path, CancellationToken cancellationToken) { - new BoxSetXmlParser(_logger).Fetch(result, path, cancellationToken); + new BoxSetXmlParser(_logger, _providerManager).Fetch(result, path, cancellationToken); } protected override FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService) diff --git a/MediaBrowser.LocalMetadata/Providers/EpisodeXmlProvider.cs b/MediaBrowser.LocalMetadata/Providers/EpisodeXmlProvider.cs index d3e365838..493df8c6a 100644 --- a/MediaBrowser.LocalMetadata/Providers/EpisodeXmlProvider.cs +++ b/MediaBrowser.LocalMetadata/Providers/EpisodeXmlProvider.cs @@ -13,11 +13,13 @@ namespace MediaBrowser.LocalMetadata.Providers public class EpisodeXmlProvider : BaseXmlProvider { private readonly ILogger _logger; + private readonly IProviderManager _providerManager; - public EpisodeXmlProvider(IFileSystem fileSystem, ILogger logger) + public EpisodeXmlProvider(IFileSystem fileSystem, ILogger logger, IProviderManager providerManager) : base(fileSystem) { _logger = logger; + _providerManager = providerManager; } protected override void Fetch(MetadataResult result, string path, CancellationToken cancellationToken) @@ -25,7 +27,7 @@ namespace MediaBrowser.LocalMetadata.Providers var images = new List(); var chapters = new List(); - new EpisodeXmlParser(_logger, FileSystem).Fetch(result, images, path, cancellationToken); + new EpisodeXmlParser(_logger, FileSystem, _providerManager).Fetch(result, images, path, cancellationToken); result.Images = images; } diff --git a/MediaBrowser.LocalMetadata/Providers/FolderXmlProvider.cs b/MediaBrowser.LocalMetadata/Providers/FolderXmlProvider.cs index 248fad363..7ac41e5cc 100644 --- a/MediaBrowser.LocalMetadata/Providers/FolderXmlProvider.cs +++ b/MediaBrowser.LocalMetadata/Providers/FolderXmlProvider.cs @@ -13,16 +13,18 @@ namespace MediaBrowser.LocalMetadata.Providers public class FolderXmlProvider : BaseXmlProvider { private readonly ILogger _logger; + private readonly IProviderManager _providerManager; - public FolderXmlProvider(IFileSystem fileSystem, ILogger logger) + public FolderXmlProvider(IFileSystem fileSystem, ILogger logger, IProviderManager providerManager) : base(fileSystem) { _logger = logger; + _providerManager = providerManager; } protected override void Fetch(MetadataResult result, string path, CancellationToken cancellationToken) { - new BaseItemXmlParser(_logger).Fetch(result, path, cancellationToken); + new BaseItemXmlParser(_logger, _providerManager).Fetch(result, path, cancellationToken); } protected override FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService) diff --git a/MediaBrowser.LocalMetadata/Providers/GameSystemXmlProvider.cs b/MediaBrowser.LocalMetadata/Providers/GameSystemXmlProvider.cs index 646fce805..942befb83 100644 --- a/MediaBrowser.LocalMetadata/Providers/GameSystemXmlProvider.cs +++ b/MediaBrowser.LocalMetadata/Providers/GameSystemXmlProvider.cs @@ -11,16 +11,18 @@ namespace MediaBrowser.LocalMetadata.Providers public class GameSystemXmlProvider : BaseXmlProvider { private readonly ILogger _logger; + private readonly IProviderManager _providerManager; - public GameSystemXmlProvider(IFileSystem fileSystem, ILogger logger) + public GameSystemXmlProvider(IFileSystem fileSystem, ILogger logger, IProviderManager providerManager) : base(fileSystem) { _logger = logger; + _providerManager = providerManager; } protected override void Fetch(MetadataResult result, string path, CancellationToken cancellationToken) { - new GameSystemXmlParser(_logger).Fetch(result, path, cancellationToken); + new GameSystemXmlParser(_logger, _providerManager).Fetch(result, path, cancellationToken); } protected override FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService) diff --git a/MediaBrowser.LocalMetadata/Providers/GameXmlProvider.cs b/MediaBrowser.LocalMetadata/Providers/GameXmlProvider.cs index 28736eddd..c562df7fb 100644 --- a/MediaBrowser.LocalMetadata/Providers/GameXmlProvider.cs +++ b/MediaBrowser.LocalMetadata/Providers/GameXmlProvider.cs @@ -11,16 +11,18 @@ namespace MediaBrowser.LocalMetadata.Providers public class GameXmlProvider : BaseXmlProvider { private readonly ILogger _logger; + private readonly IProviderManager _providerManager; - public GameXmlProvider(IFileSystem fileSystem, ILogger logger) + public GameXmlProvider(IFileSystem fileSystem, ILogger logger, IProviderManager providerManager) : base(fileSystem) { _logger = logger; + _providerManager = providerManager; } protected override void Fetch(MetadataResult result, string path, CancellationToken cancellationToken) { - new GameXmlParser(_logger).Fetch(result, path, cancellationToken); + new GameXmlParser(_logger, _providerManager).Fetch(result, path, cancellationToken); } protected override FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService) diff --git a/MediaBrowser.LocalMetadata/Providers/MovieXmlProvider.cs b/MediaBrowser.LocalMetadata/Providers/MovieXmlProvider.cs index e4f83dd1f..333ea2823 100644 --- a/MediaBrowser.LocalMetadata/Providers/MovieXmlProvider.cs +++ b/MediaBrowser.LocalMetadata/Providers/MovieXmlProvider.cs @@ -11,16 +11,18 @@ namespace MediaBrowser.LocalMetadata.Providers public class MovieXmlProvider : BaseXmlProvider { private readonly ILogger _logger; + private readonly IProviderManager _providerManager; - public MovieXmlProvider(IFileSystem fileSystem, ILogger logger) + public MovieXmlProvider(IFileSystem fileSystem, ILogger logger, IProviderManager providerManager) : base(fileSystem) { _logger = logger; + _providerManager = providerManager; } protected override void Fetch(MetadataResult result, string path, CancellationToken cancellationToken) { - new MovieXmlParser(_logger).Fetch(result, path, cancellationToken); + new MovieXmlParser(_logger, _providerManager).Fetch(result, path, cancellationToken); } protected override FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService) diff --git a/MediaBrowser.LocalMetadata/Providers/MusicVideoXmlProvider.cs b/MediaBrowser.LocalMetadata/Providers/MusicVideoXmlProvider.cs index 1060fe895..49d8c09cc 100644 --- a/MediaBrowser.LocalMetadata/Providers/MusicVideoXmlProvider.cs +++ b/MediaBrowser.LocalMetadata/Providers/MusicVideoXmlProvider.cs @@ -10,16 +10,18 @@ namespace MediaBrowser.LocalMetadata.Providers class MusicVideoXmlProvider : BaseXmlProvider { private readonly ILogger _logger; + private readonly IProviderManager _providerManager; - public MusicVideoXmlProvider(IFileSystem fileSystem, ILogger logger) + public MusicVideoXmlProvider(IFileSystem fileSystem, ILogger logger, IProviderManager providerManager) : base(fileSystem) { _logger = logger; + _providerManager = providerManager; } protected override void Fetch(MetadataResult result, string path, CancellationToken cancellationToken) { - new MusicVideoXmlParser(_logger).Fetch(result, path, cancellationToken); + new MusicVideoXmlParser(_logger, _providerManager).Fetch(result, path, cancellationToken); } protected override FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService) diff --git a/MediaBrowser.LocalMetadata/Providers/PersonXmlProvider.cs b/MediaBrowser.LocalMetadata/Providers/PersonXmlProvider.cs index b65977c8e..2ccb8968b 100644 --- a/MediaBrowser.LocalMetadata/Providers/PersonXmlProvider.cs +++ b/MediaBrowser.LocalMetadata/Providers/PersonXmlProvider.cs @@ -10,16 +10,18 @@ namespace MediaBrowser.LocalMetadata.Providers public class PersonXmlProvider : BaseXmlProvider { private readonly ILogger _logger; + private readonly IProviderManager _providerManager; - public PersonXmlProvider(IFileSystem fileSystem, ILogger logger) + public PersonXmlProvider(IFileSystem fileSystem, ILogger logger, IProviderManager providerManager) : base(fileSystem) { _logger = logger; + _providerManager = providerManager; } protected override void Fetch(MetadataResult result, string path, CancellationToken cancellationToken) { - new BaseItemXmlParser(_logger).Fetch(result, path, cancellationToken); + new BaseItemXmlParser(_logger, _providerManager).Fetch(result, path, cancellationToken); } protected override FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService) diff --git a/MediaBrowser.LocalMetadata/Providers/PlaylistXmlProvider.cs b/MediaBrowser.LocalMetadata/Providers/PlaylistXmlProvider.cs index eb9e9a660..149a3142d 100644 --- a/MediaBrowser.LocalMetadata/Providers/PlaylistXmlProvider.cs +++ b/MediaBrowser.LocalMetadata/Providers/PlaylistXmlProvider.cs @@ -11,16 +11,18 @@ namespace MediaBrowser.LocalMetadata.Providers class PlaylistXmlProvider : BaseXmlProvider { private readonly ILogger _logger; + private readonly IProviderManager _providerManager; - public PlaylistXmlProvider(IFileSystem fileSystem, ILogger logger) + public PlaylistXmlProvider(IFileSystem fileSystem, ILogger logger, IProviderManager providerManager) : base(fileSystem) { _logger = logger; + _providerManager = providerManager; } protected override void Fetch(MetadataResult result, string path, CancellationToken cancellationToken) { - new PlaylistXmlParser(_logger).Fetch(result, path, cancellationToken); + new PlaylistXmlParser(_logger, _providerManager).Fetch(result, path, cancellationToken); } protected override FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService) diff --git a/MediaBrowser.LocalMetadata/Providers/SeasonXmlProvider.cs b/MediaBrowser.LocalMetadata/Providers/SeasonXmlProvider.cs index 7c82d9811..75af906cb 100644 --- a/MediaBrowser.LocalMetadata/Providers/SeasonXmlProvider.cs +++ b/MediaBrowser.LocalMetadata/Providers/SeasonXmlProvider.cs @@ -14,16 +14,18 @@ namespace MediaBrowser.LocalMetadata.Providers public class SeasonXmlProvider : BaseXmlProvider, IHasOrder { private readonly ILogger _logger; + private readonly IProviderManager _providerManager; - public SeasonXmlProvider(IFileSystem fileSystem, ILogger logger) + public SeasonXmlProvider(IFileSystem fileSystem, ILogger logger, IProviderManager providerManager) : base(fileSystem) { _logger = logger; + _providerManager = providerManager; } protected override void Fetch(MetadataResult result, string path, CancellationToken cancellationToken) { - new SeasonXmlParser(_logger).Fetch(result, path, cancellationToken); + new SeasonXmlParser(_logger, _providerManager).Fetch(result, path, cancellationToken); } protected override FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService) diff --git a/MediaBrowser.LocalMetadata/Providers/SeriesXmlProvider.cs b/MediaBrowser.LocalMetadata/Providers/SeriesXmlProvider.cs index 0893f192f..26d3c7539 100644 --- a/MediaBrowser.LocalMetadata/Providers/SeriesXmlProvider.cs +++ b/MediaBrowser.LocalMetadata/Providers/SeriesXmlProvider.cs @@ -14,16 +14,18 @@ namespace MediaBrowser.LocalMetadata.Providers public class SeriesXmlProvider : BaseXmlProvider, IHasOrder { private readonly ILogger _logger; + private readonly IProviderManager _providerManager; - public SeriesXmlProvider(IFileSystem fileSystem, ILogger logger) + public SeriesXmlProvider(IFileSystem fileSystem, ILogger logger, IProviderManager providerManager) : base(fileSystem) { _logger = logger; + _providerManager = providerManager; } protected override void Fetch(MetadataResult result, string path, CancellationToken cancellationToken) { - new SeriesXmlParser(_logger).Fetch(result, path, cancellationToken); + new SeriesXmlParser(_logger, _providerManager).Fetch(result, path, cancellationToken); } protected override FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService) diff --git a/MediaBrowser.LocalMetadata/Providers/VideoXmlProvider.cs b/MediaBrowser.LocalMetadata/Providers/VideoXmlProvider.cs index c7bde4fa8..50f3bcda4 100644 --- a/MediaBrowser.LocalMetadata/Providers/VideoXmlProvider.cs +++ b/MediaBrowser.LocalMetadata/Providers/VideoXmlProvider.cs @@ -10,16 +10,18 @@ namespace MediaBrowser.LocalMetadata.Providers class VideoXmlProvider : BaseXmlProvider