mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-14 06:12:17 +01:00
update DisplayParent
This commit is contained in:
@@ -306,7 +306,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
}
|
||||
|
||||
private List<Tuple<StringBuilder,bool>> GetSortChunks(string s1)
|
||||
private List<Tuple<StringBuilder, bool>> GetSortChunks(string s1)
|
||||
{
|
||||
var list = new List<Tuple<StringBuilder, bool>>();
|
||||
|
||||
@@ -668,9 +668,30 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public virtual BaseItem DisplayParent
|
||||
public virtual Guid? DisplayParentId
|
||||
{
|
||||
get { return GetParent(); }
|
||||
get
|
||||
{
|
||||
if (ParentId == Guid.Empty)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return ParentId;
|
||||
}
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public BaseItem DisplayParent
|
||||
{
|
||||
get
|
||||
{
|
||||
var id = DisplayParentId;
|
||||
if (!id.HasValue)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return LibraryManager.GetItemById(id.Value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1454,7 +1475,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
public virtual string GetClientTypeName()
|
||||
{
|
||||
if (IsFolder && SourceType == SourceType.Channel)
|
||||
if (IsFolder && SourceType == SourceType.Channel && !(this is Channel))
|
||||
{
|
||||
return "ChannelFolderItem";
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using MediaBrowser.Model.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
@@ -18,11 +19,20 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <value>The local trailer ids.</value>
|
||||
List<Guid> LocalTrailerIds { get; set; }
|
||||
List<Guid> RemoteTrailerIds { get; set; }
|
||||
}
|
||||
|
||||
public static class HasTrailerExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the trailer ids.
|
||||
/// </summary>
|
||||
/// <returns>List<Guid>.</returns>
|
||||
List<Guid> GetTrailerIds();
|
||||
public static List<Guid> GetTrailerIds(this IHasTrailers item)
|
||||
{
|
||||
var list = item.LocalTrailerIds.ToList();
|
||||
list.AddRange(item.RemoteTrailerIds);
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,17 +78,6 @@ namespace MediaBrowser.Controller.Entities.Movies
|
||||
set { TmdbCollectionName = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the trailer ids.
|
||||
/// </summary>
|
||||
/// <returns>List<Guid>.</returns>
|
||||
public List<Guid> GetTrailerIds()
|
||||
{
|
||||
var list = LocalTrailerIds.ToList();
|
||||
list.AddRange(RemoteTrailerIds);
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the user data key.
|
||||
/// </summary>
|
||||
|
||||
@@ -90,11 +90,11 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public override BaseItem DisplayParent
|
||||
public override Guid? DisplayParentId
|
||||
{
|
||||
get
|
||||
{
|
||||
return Season ?? GetParent();
|
||||
return SeasonId;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,9 +33,13 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public override BaseItem DisplayParent
|
||||
public override Guid? DisplayParentId
|
||||
{
|
||||
get { return Series ?? GetParent(); }
|
||||
get
|
||||
{
|
||||
var series = Series;
|
||||
return series == null ? ParentId : series.Id;
|
||||
}
|
||||
}
|
||||
|
||||
// Genre, Rating and Stuido will all be the same
|
||||
|
||||
Reference in New Issue
Block a user