From 12e58840eb6d7045e6b706580e057f4fb910fc3d Mon Sep 17 00:00:00 2001 From: David Ullmer Date: Fri, 13 Aug 2021 20:33:53 +0200 Subject: [PATCH] Modify FetchThumbNode method to read children of fanart tag --- .../Parsers/BaseNfoParser.cs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs b/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs index 242a7132b..0edb7f43c 100644 --- a/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs +++ b/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs @@ -787,6 +787,14 @@ namespace MediaBrowser.XbmcMetadata.Parsers break; } + case "fanart": + { + var subtree = reader.ReadSubtree(); + subtree.ReadToDescendant("thumb"); + FetchThumbNode(subtree, itemResult); + break; + } + default: string readerName = reader.Name; if (_validProviderIds.TryGetValue(readerName, out string? providerIdValue)) @@ -811,11 +819,17 @@ namespace MediaBrowser.XbmcMetadata.Parsers var artType = reader.GetAttribute("aspect"); var val = reader.ReadElementContentAsString(); + // artType is null if the thumb node is a child of the fanart tag + // -> set image type to fanart + if (string.IsNullOrWhiteSpace(artType)) + { + artType = "fanart"; + } + // skip: - // - empty aspect tag // - empty uri // - tag containing '.' because we can't set images for seasons, episodes or movie sets within series or movies - if (string.IsNullOrEmpty(artType) || string.IsNullOrEmpty(val) || artType.Contains('.', StringComparison.Ordinal)) + if (string.IsNullOrEmpty(val) || artType.Contains('.', StringComparison.Ordinal)) { return; }