mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-20 07:45:26 +03:00
Fix several Stackoverflows (#14783)
This commit is contained in:
@@ -701,19 +701,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
get
|
||||
{
|
||||
var customRating = CustomRating;
|
||||
if (!string.IsNullOrEmpty(customRating))
|
||||
{
|
||||
return customRating;
|
||||
}
|
||||
|
||||
var parent = DisplayParent;
|
||||
if (parent is not null)
|
||||
{
|
||||
return parent.CustomRatingForComparison;
|
||||
}
|
||||
|
||||
return null;
|
||||
return GetCustomRatingForComparision();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -791,6 +779,26 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <value>The remote trailers.</value>
|
||||
public IReadOnlyList<MediaUrl> RemoteTrailers { get; set; }
|
||||
|
||||
private string GetCustomRatingForComparision(HashSet<Guid> callstack = null)
|
||||
{
|
||||
callstack ??= new();
|
||||
var customRating = CustomRating;
|
||||
if (!string.IsNullOrEmpty(customRating))
|
||||
{
|
||||
return customRating;
|
||||
}
|
||||
|
||||
callstack.Add(Id);
|
||||
|
||||
var parent = DisplayParent;
|
||||
if (parent is not null && !callstack.Contains(parent.Id))
|
||||
{
|
||||
return parent.GetCustomRatingForComparision(callstack);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public virtual double GetDefaultPrimaryImageAspectRatio()
|
||||
{
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user