mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 01:24:44 +01:00
added critic rating interface
This commit is contained in:
@@ -792,11 +792,15 @@ namespace MediaBrowser.Server.Implementations.Dto
|
||||
dto.MediaType = item.MediaType;
|
||||
dto.LocationType = item.LocationType;
|
||||
|
||||
dto.CriticRating = item.CriticRating;
|
||||
|
||||
if (fields.Contains(ItemFields.CriticRatingSummary))
|
||||
var hasCriticRating = item as IHasCriticRating;
|
||||
if (hasCriticRating != null)
|
||||
{
|
||||
dto.CriticRatingSummary = item.CriticRatingSummary;
|
||||
dto.CriticRating = hasCriticRating.CriticRating;
|
||||
|
||||
if (fields.Contains(ItemFields.CriticRatingSummary))
|
||||
{
|
||||
dto.CriticRatingSummary = hasCriticRating.CriticRatingSummary;
|
||||
}
|
||||
}
|
||||
|
||||
var localTrailerCount = item.LocalTrailerIds.Count;
|
||||
|
||||
@@ -22,7 +22,9 @@ namespace MediaBrowser.Server.Implementations.Sorting
|
||||
|
||||
private float GetValue(BaseItem x)
|
||||
{
|
||||
return x.CriticRating ?? 0;
|
||||
var hasCriticRating = x as IHasCriticRating;
|
||||
|
||||
return hasCriticRating == null ? 0 : hasCriticRating.CriticRating ?? 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user