| | 1 | | using System; |
| | 2 | | using System.Collections.Generic; |
| | 3 | | using System.ComponentModel; |
| | 4 | | using System.Text.Json.Serialization; |
| | 5 | | using Jellyfin.Data.Enums; |
| | 6 | | using Jellyfin.Extensions.Json.Converters; |
| | 7 | | using MediaBrowser.Model.Dlna; |
| | 8 | | using MediaBrowser.Model.Session; |
| | 9 | |
|
| | 10 | | namespace Jellyfin.Api.Models.SessionDtos; |
| | 11 | |
|
| | 12 | | /// <summary> |
| | 13 | | /// Client capabilities dto. |
| | 14 | | /// </summary> |
| | 15 | | public class ClientCapabilitiesDto |
| | 16 | | { |
| | 17 | | /// <summary> |
| | 18 | | /// Gets or sets the list of playable media types. |
| | 19 | | /// </summary> |
| | 20 | | [JsonConverter(typeof(JsonCommaDelimitedArrayConverterFactory))] |
| | 21 | | public IReadOnlyList<MediaType> PlayableMediaTypes { get; set; } = Array.Empty<MediaType>(); |
| | 22 | |
|
| | 23 | | /// <summary> |
| | 24 | | /// Gets or sets the list of supported commands. |
| | 25 | | /// </summary> |
| | 26 | | [JsonConverter(typeof(JsonCommaDelimitedArrayConverterFactory))] |
| | 27 | | public IReadOnlyList<GeneralCommandType> SupportedCommands { get; set; } = Array.Empty<GeneralCommandType>(); |
| | 28 | |
|
| | 29 | | /// <summary> |
| | 30 | | /// Gets or sets a value indicating whether session supports media control. |
| | 31 | | /// </summary> |
| | 32 | | public bool SupportsMediaControl { get; set; } |
| | 33 | |
|
| | 34 | | /// <summary> |
| | 35 | | /// Gets or sets a value indicating whether session supports a persistent identifier. |
| | 36 | | /// </summary> |
| | 37 | | public bool SupportsPersistentIdentifier { get; set; } |
| | 38 | |
|
| | 39 | | /// <summary> |
| | 40 | | /// Gets or sets the device profile. |
| | 41 | | /// </summary> |
| | 42 | | public DeviceProfile? DeviceProfile { get; set; } |
| | 43 | |
|
| | 44 | | /// <summary> |
| | 45 | | /// Gets or sets the app store url. |
| | 46 | | /// </summary> |
| | 47 | | public string? AppStoreUrl { get; set; } |
| | 48 | |
|
| | 49 | | /// <summary> |
| | 50 | | /// Gets or sets the icon url. |
| | 51 | | /// </summary> |
| | 52 | | public string? IconUrl { get; set; } |
| | 53 | |
|
| | 54 | | #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member |
| | 55 | | // TODO: Remove after 10.9 |
| | 56 | | [Obsolete("Unused")] |
| | 57 | | [DefaultValue(false)] |
| 0 | 58 | | public bool? SupportsContentUploading { get; set; } = false; |
| | 59 | |
|
| | 60 | | // TODO: Remove after 10.9 |
| | 61 | | [Obsolete("Unused")] |
| | 62 | | [DefaultValue(false)] |
| 0 | 63 | | public bool? SupportsSync { get; set; } = false; |
| | 64 | | #pragma warning restore CS1591 // Missing XML comment for publicly visible type or member |
| | 65 | |
|
| | 66 | | /// <summary> |
| | 67 | | /// Convert the dto to the full <see cref="ClientCapabilities"/> model. |
| | 68 | | /// </summary> |
| | 69 | | /// <returns>The converted <see cref="ClientCapabilities"/> model.</returns> |
| | 70 | | public ClientCapabilities ToClientCapabilities() |
| | 71 | | { |
| 0 | 72 | | return new ClientCapabilities |
| 0 | 73 | | { |
| 0 | 74 | | PlayableMediaTypes = PlayableMediaTypes, |
| 0 | 75 | | SupportedCommands = SupportedCommands, |
| 0 | 76 | | SupportsMediaControl = SupportsMediaControl, |
| 0 | 77 | | SupportsPersistentIdentifier = SupportsPersistentIdentifier, |
| 0 | 78 | | DeviceProfile = DeviceProfile, |
| 0 | 79 | | AppStoreUrl = AppStoreUrl, |
| 0 | 80 | | IconUrl = IconUrl |
| 0 | 81 | | }; |
| | 82 | | } |
| | 83 | | } |