From b93ace6cbfadedff32b997aa06c1899d9cc067aa Mon Sep 17 00:00:00 2001 From: cxfksword <718792+cxfksword@users.noreply.github.com> Date: Wed, 4 Sep 2024 15:54:14 +0800 Subject: [PATCH] fix: optimize boxset meta --- .../Providers/BoxSetProvider.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Jellyfin.Plugin.MetaShark/Providers/BoxSetProvider.cs b/Jellyfin.Plugin.MetaShark/Providers/BoxSetProvider.cs index 03dccf9..334a565 100644 --- a/Jellyfin.Plugin.MetaShark/Providers/BoxSetProvider.cs +++ b/Jellyfin.Plugin.MetaShark/Providers/BoxSetProvider.cs @@ -5,7 +5,9 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using Jellyfin.Data.Enums; using Jellyfin.Plugin.MetaShark.Api; +using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.Movies; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Providers; @@ -118,6 +120,16 @@ public async Task> GetMetadata(BoxSetInfo info, Cancellat Overview = collection.Overview, }; + var oldBotSet = _libraryManager.GetItemList(new InternalItemsQuery + { + IncludeItemTypes = new[] { BaseItemKind.BoxSet }, + CollapseBoxSetItems = false, + Recursive = true + }).Select(b => b as BoxSet).FirstOrDefault(x => x.Name == collection.Name); + if (oldBotSet != null) + { + item.LinkedChildren = oldBotSet.LinkedChildren; + } item.SetProviderId(MetadataProvider.Tmdb, collection.Id.ToString(CultureInfo.InvariantCulture)); result.HasMetadata = true;