From 5feb70f489670808be682e1f2f80c4780651c57b Mon Sep 17 00:00:00 2001 From: Shadowghost Date: Fri, 29 May 2026 10:41:50 +0200 Subject: Fix recently added episode links and posters --- MediaBrowser.Controller/Dto/DtoOptions.cs | 56 ++++++++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 5 deletions(-) (limited to 'MediaBrowser.Controller') diff --git a/MediaBrowser.Controller/Dto/DtoOptions.cs b/MediaBrowser.Controller/Dto/DtoOptions.cs index a71cdbd62c..d319feb6b2 100644 --- a/MediaBrowser.Controller/Dto/DtoOptions.cs +++ b/MediaBrowser.Controller/Dto/DtoOptions.cs @@ -1,5 +1,3 @@ -#pragma warning disable CS1591 - using System; using System.Collections.Generic; using System.Linq; @@ -8,13 +6,16 @@ using MediaBrowser.Model.Querying; namespace MediaBrowser.Controller.Dto { + /// + /// Options that control which fields and images are populated when building a . + /// public class DtoOptions { - private static readonly ItemFields[] DefaultExcludedFields = new[] - { + private static readonly ItemFields[] DefaultExcludedFields = + [ ItemFields.SeasonUserData, ItemFields.RefreshState - }; + ]; private static readonly ImageType[] AllImageTypes = Enum.GetValues(); @@ -22,11 +23,18 @@ namespace MediaBrowser.Controller.Dto .Except(DefaultExcludedFields) .ToArray(); + /// + /// Initializes a new instance of the class with all fields enabled. + /// public DtoOptions() : this(true) { } + /// + /// Initializes a new instance of the class. + /// + /// Whether to populate all available fields. public DtoOptions(bool allFields) { ImageTypeLimit = int.MaxValue; @@ -38,23 +46,61 @@ namespace MediaBrowser.Controller.Dto ImageTypes = AllImageTypes; } + /// + /// Gets or sets the fields to populate on the DTO. + /// public IReadOnlyList Fields { get; set; } + /// + /// Gets or sets the image types to populate on the DTO. + /// public IReadOnlyList ImageTypes { get; set; } + /// + /// Gets or sets the maximum number of images to return per image type. + /// public int ImageTypeLimit { get; set; } + /// + /// Gets or sets a value indicating whether image information is populated. + /// public bool EnableImages { get; set; } + /// + /// Gets or sets a value indicating whether program recording information is populated. + /// public bool AddProgramRecordingInfo { get; set; } + /// + /// Gets or sets a value indicating whether user data is populated. + /// public bool EnableUserData { get; set; } + /// + /// Gets or sets a value indicating whether the currently airing program is populated. + /// public bool AddCurrentProgram { get; set; } + /// + /// Gets or sets a value indicating whether an episode's portrait poster (its season's primary + /// image, falling back to the series') should replace the episode's own (16:9) primary image. + /// Used by views that render episodes as poster cards, e.g. "Latest". + /// + public bool PreferEpisodeParentPoster { get; set; } + + /// + /// Gets a value indicating whether the specified field is populated. + /// + /// The field to check. + /// true if the field is populated; otherwise, false. public bool ContainsField(ItemFields field) => Fields.Contains(field); + /// + /// Gets the number of images to return for the specified image type. + /// + /// The image type. + /// The image limit for the type, or 0 if the type is not enabled. public int GetImageLimit(ImageType type) { if (EnableImages && ImageTypes.Contains(type)) -- cgit v1.2.3