diff --git a/Shoko.Server/API/v3/Models/Common/Image.cs b/Shoko.Server/API/v3/Models/Common/Image.cs index 83c5d2780..e8e099915 100644 --- a/Shoko.Server/API/v3/Models/Common/Image.cs +++ b/Shoko.Server/API/v3/Models/Common/Image.cs @@ -72,6 +72,12 @@ public class Image /// public int? Height { get; set; } + /// + /// Community rating for the image, if available. + /// + [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] + public Rating? CommunityRating { get; set; } + /// /// Series info for the image, currently only set when sending a random /// image. @@ -97,6 +103,14 @@ public Image(IImageMetadata imageMetadata, bool? preferredOverride = null) { Width = tmdbImage.Width; Height = tmdbImage.Height; + CommunityRating = new() + { + Value = (decimal)tmdbImage.UserRating, + Votes = tmdbImage.UserVotes, + MaxValue = 10, + Type = "User", + Source = "TMDB", + }; } else if (imageMetadata is Image_Base imageBase && imageBase._width.HasValue && imageBase._height.HasValue) { @@ -152,6 +166,14 @@ public Image(int id, ImageEntityType imageEntityType, DataSourceType dataSource, } Width = tmdbImage.Width; Height = tmdbImage.Height; + CommunityRating = new() + { + Value = (decimal)tmdbImage.UserRating, + Votes = tmdbImage.UserVotes, + MaxValue = 10, + Type = "User", + Source = "TMDB", + }; } break;