using System; using System.Collections.Generic; using System.ComponentModel; using System.Text.Json.Serialization; using Jellyfin.Data.Enums; using Jellyfin.Extensions.Json.Converters; using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Session; namespace Jellyfin.Api.Models.SessionDtos; /// /// Client capabilities dto. /// public class ClientCapabilitiesDto { /// /// Gets or sets the list of playable media types. /// [JsonConverter(typeof(JsonCommaDelimitedArrayConverterFactory))] public IReadOnlyList PlayableMediaTypes { get; set; } = Array.Empty(); /// /// Gets or sets the list of supported commands. /// [JsonConverter(typeof(JsonCommaDelimitedArrayConverterFactory))] public IReadOnlyList SupportedCommands { get; set; } = Array.Empty(); /// /// Gets or sets a value indicating whether session supports media control. /// public bool SupportsMediaControl { get; set; } /// /// Gets or sets a value indicating whether session supports a persistent identifier. /// public bool SupportsPersistentIdentifier { get; set; } /// /// Gets or sets the device profile. /// public DeviceProfile? DeviceProfile { get; set; } /// /// Gets or sets the app store url. /// public string? AppStoreUrl { get; set; } /// /// Gets or sets the icon url. /// public string? IconUrl { get; set; } #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member // TODO: Remove after 10.9 [Obsolete("Unused")] [DefaultValue(false)] public bool? SupportsContentUploading { get; set; } // TODO: Remove after 10.9 [Obsolete("Unused")] [DefaultValue(false)] public bool? SupportsSync { get; set; } #pragma warning restore CS1591 // Missing XML comment for publicly visible type or member /// /// Convert the dto to the full model. /// /// The converted model. public ClientCapabilities ToClientCapabilities() { return new ClientCapabilities { PlayableMediaTypes = PlayableMediaTypes, SupportedCommands = SupportedCommands, SupportsMediaControl = SupportsMediaControl, SupportsPersistentIdentifier = SupportsPersistentIdentifier, DeviceProfile = DeviceProfile, AppStoreUrl = AppStoreUrl, IconUrl = IconUrl }; } }