mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-05-24 02:02:29 -04:00
Add channel queries to series (#13356)
Currently, the IChannel interface can deliver channel result folders which are interpreted as series and seasons. However, Jellyfin does not query for the contents of these folders when viewing said serie of season. This results in empty series in the API.
This commit is contained in:
parent
07f07ba6bc
commit
9f70578997
@ -23,6 +23,7 @@ using MediaBrowser.Controller.Chapters;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Dto;
|
||||
using MediaBrowser.Controller.Entities.Audio;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Persistence;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
@ -1683,7 +1684,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
public virtual string GetClientTypeName()
|
||||
{
|
||||
if (IsFolder && SourceType == SourceType.Channel && this is not Channel)
|
||||
if (IsFolder && SourceType == SourceType.Channel && this is not Channel && this is not Season && this is not Series)
|
||||
{
|
||||
return "ChannelFolderItem";
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading;
|
||||
using Jellyfin.Data.Enums;
|
||||
using Jellyfin.Database.Implementations.Entities;
|
||||
using Jellyfin.Extensions;
|
||||
@ -152,6 +153,21 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
|
||||
protected override QueryResult<BaseItem> GetItemsInternal(InternalItemsQuery query)
|
||||
{
|
||||
if (SourceType == SourceType.Channel)
|
||||
{
|
||||
try
|
||||
{
|
||||
query.Parent = this;
|
||||
query.ChannelIds = new[] { ChannelId };
|
||||
return ChannelManager.GetChannelItemsInternal(query, new Progress<double>(), CancellationToken.None).GetAwaiter().GetResult();
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Already logged at lower levels
|
||||
return new QueryResult<BaseItem>();
|
||||
}
|
||||
}
|
||||
|
||||
if (query.User is null)
|
||||
{
|
||||
return base.GetItemsInternal(query);
|
||||
|
@ -226,6 +226,21 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
{
|
||||
var user = query.User;
|
||||
|
||||
if (SourceType == SourceType.Channel)
|
||||
{
|
||||
try
|
||||
{
|
||||
query.Parent = this;
|
||||
query.ChannelIds = [ChannelId];
|
||||
return ChannelManager.GetChannelItemsInternal(query, new Progress<double>(), CancellationToken.None).GetAwaiter().GetResult();
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Already logged at lower levels
|
||||
return new QueryResult<BaseItem>();
|
||||
}
|
||||
}
|
||||
|
||||
if (query.Recursive)
|
||||
{
|
||||
var seriesKey = GetUniqueSeriesKey(this);
|
||||
@ -372,7 +387,25 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
query.IsMissing = false;
|
||||
}
|
||||
|
||||
var allItems = LibraryManager.GetItemList(query);
|
||||
IReadOnlyList<BaseItem> allItems;
|
||||
if (SourceType == SourceType.Channel)
|
||||
{
|
||||
try
|
||||
{
|
||||
query.Parent = parentSeason;
|
||||
query.ChannelIds = [ChannelId];
|
||||
allItems = [.. ChannelManager.GetChannelItemsInternal(query, new Progress<double>(), CancellationToken.None).GetAwaiter().GetResult().Items];
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Already logged at lower levels
|
||||
return [];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
allItems = LibraryManager.GetItemList(query);
|
||||
}
|
||||
|
||||
return GetSeasonEpisodes(parentSeason, user, allItems, options, shouldIncludeMissingEpisodes);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user