Skip to content

Commit

Permalink
fix: optimize boxset meta
Browse files Browse the repository at this point in the history
  • Loading branch information
cxfksword committed Sep 4, 2024
1 parent 90dcea6 commit b93ace6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Jellyfin.Plugin.MetaShark/Providers/BoxSetProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -118,6 +120,16 @@ public async Task<MetadataResult<BoxSet>> 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;
Expand Down

0 comments on commit b93ace6

Please sign in to comment.