using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
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 content uploading.
///
public bool SupportsContentUploading { get; set; }
///
/// Gets or sets the message callback url.
///
public string? MessageCallbackUrl { get; set; }
///
/// Gets or sets a value indicating whether session supports a persistent identifier.
///
public bool SupportsPersistentIdentifier { get; set; }
///
/// Gets or sets a value indicating whether session supports sync.
///
public bool SupportsSync { 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; }
///
/// Convert the dto to the full model.
///
/// The converted model.
public ClientCapabilities ToClientCapabilities()
{
return new ClientCapabilities
{
PlayableMediaTypes = PlayableMediaTypes,
SupportedCommands = SupportedCommands,
SupportsMediaControl = SupportsMediaControl,
SupportsContentUploading = SupportsContentUploading,
MessageCallbackUrl = MessageCallbackUrl,
SupportsPersistentIdentifier = SupportsPersistentIdentifier,
SupportsSync = SupportsSync,
DeviceProfile = DeviceProfile,
AppStoreUrl = AppStoreUrl,
IconUrl = IconUrl
};
}
}
}