diff options
| author | KGT1 <kilian.gamn@gmail.com> | 2026-05-05 12:08:11 +0000 |
|---|---|---|
| committer | KGT1 <kilian.gamn@gmail.com> | 2026-05-05 12:12:49 +0000 |
| commit | 0bbb2ae633225425e4af6839198dcb382a153cf7 (patch) | |
| tree | 1fd71d2b21b9a6c553a72c3d78ce1eac55c6cf57 | |
| parent | f8ff13c8f491947a652491afa6dd407ee08980e7 (diff) | |
create DTOs for all config endpoints
| -rw-r--r-- | Jellyfin.Api/Controllers/ConfigurationController.cs | 433 | ||||
| -rw-r--r-- | MediaBrowser.Common/Net/NetworkConfigurationDto.cs | 126 | ||||
| -rw-r--r-- | MediaBrowser.Model/Configuration/EncodingOptionsDto.cs | 309 | ||||
| -rw-r--r-- | MediaBrowser.Model/Configuration/MetadataConfigurationDto.cs | 12 | ||||
| -rw-r--r-- | MediaBrowser.Model/Configuration/ServerConfigurationDto.cs | 177 | ||||
| -rw-r--r-- | MediaBrowser.Model/Configuration/XbmcMetadataOptionsDto.cs | 32 | ||||
| -rw-r--r-- | MediaBrowser.Model/LiveTv/LiveTvOptionsDto.cs | 97 |
7 files changed, 1162 insertions, 24 deletions
diff --git a/Jellyfin.Api/Controllers/ConfigurationController.cs b/Jellyfin.Api/Controllers/ConfigurationController.cs index 5c946e5edf..f4ebfd52ba 100644 --- a/Jellyfin.Api/Controllers/ConfigurationController.cs +++ b/Jellyfin.Api/Controllers/ConfigurationController.cs @@ -1,4 +1,5 @@ using System.ComponentModel.DataAnnotations; +using System.Linq; using MediaBrowser.Common.Api; using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Net; @@ -38,9 +39,9 @@ public class ConfigurationController : BaseJellyfinApiController /// <returns>Application configuration.</returns> [HttpGet("Configuration")] [ProducesResponseType(StatusCodes.Status200OK)] - public ActionResult<ServerConfiguration> GetConfiguration() + public ActionResult<ServerConfigurationDto> GetConfiguration() { - return _configurationManager.Configuration; + return MapToDto(_configurationManager.Configuration); } /// <summary> @@ -52,9 +53,9 @@ public class ConfigurationController : BaseJellyfinApiController [HttpPost("Configuration")] [Authorize(Policy = Policies.RequiresElevation)] [ProducesResponseType(StatusCodes.Status204NoContent)] - public ActionResult UpdateConfiguration([FromBody, Required] ServerConfiguration configuration) + public ActionResult UpdateConfiguration([FromBody, Required] ServerConfigurationDto configuration) { - _configurationManager.ReplaceConfiguration(configuration); + _configurationManager.ReplaceConfiguration(MapToInternal(configuration)); return NoContent(); } @@ -78,9 +79,9 @@ public class ConfigurationController : BaseJellyfinApiController /// <returns>Encoding configuration.</returns> [HttpGet("Configuration/Encoding")] [ProducesResponseType(StatusCodes.Status200OK)] - public ActionResult<EncodingOptions> GetEncodingConfiguration() + public ActionResult<EncodingOptionsDto> GetEncodingConfiguration() { - return _configurationManager.GetConfiguration<EncodingOptions>("encoding"); + return MapToDto(_configurationManager.GetConfiguration<EncodingOptions>("encoding")); } /// <summary> @@ -92,9 +93,9 @@ public class ConfigurationController : BaseJellyfinApiController [HttpPost("Configuration/Encoding")] [Authorize(Policy = Policies.RequiresElevation)] [ProducesResponseType(StatusCodes.Status204NoContent)] - public ActionResult UpdateEncodingConfiguration([FromBody, Required] EncodingOptions configuration) + public ActionResult UpdateEncodingConfiguration([FromBody, Required] EncodingOptionsDto configuration) { - _configurationManager.SaveConfiguration("encoding", configuration); + _configurationManager.SaveConfiguration("encoding", MapToInternal(configuration)); return NoContent(); } @@ -105,9 +106,9 @@ public class ConfigurationController : BaseJellyfinApiController /// <returns>Network configuration.</returns> [HttpGet("Configuration/Network")] [ProducesResponseType(StatusCodes.Status200OK)] - public ActionResult<NetworkConfiguration> GetNetworkConfiguration() + public ActionResult<NetworkConfigurationDto> GetNetworkConfiguration() { - return _configurationManager.GetConfiguration<NetworkConfiguration>("network"); + return MapToDto(_configurationManager.GetConfiguration<NetworkConfiguration>("network")); } /// <summary> @@ -119,9 +120,9 @@ public class ConfigurationController : BaseJellyfinApiController [HttpPost("Configuration/Network")] [Authorize(Policy = Policies.RequiresElevation)] [ProducesResponseType(StatusCodes.Status204NoContent)] - public ActionResult UpdateNetworkConfiguration([FromBody, Required] NetworkConfiguration configuration) + public ActionResult UpdateNetworkConfiguration([FromBody, Required] NetworkConfigurationDto configuration) { - _configurationManager.SaveConfiguration("network", configuration); + _configurationManager.SaveConfiguration("network", MapToInternal(configuration)); return NoContent(); } @@ -132,9 +133,9 @@ public class ConfigurationController : BaseJellyfinApiController /// <returns>Metadata configuration.</returns> [HttpGet("Configuration/Metadata")] [ProducesResponseType(StatusCodes.Status200OK)] - public ActionResult<MetadataConfiguration> GetMetadataConfiguration() + public ActionResult<MetadataConfigurationDto> GetMetadataConfiguration() { - return _configurationManager.GetConfiguration<MetadataConfiguration>("metadata"); + return MapToDto(_configurationManager.GetConfiguration<MetadataConfiguration>("metadata")); } /// <summary> @@ -146,9 +147,9 @@ public class ConfigurationController : BaseJellyfinApiController [HttpPost("Configuration/Metadata")] [Authorize(Policy = Policies.RequiresElevation)] [ProducesResponseType(StatusCodes.Status204NoContent)] - public ActionResult UpdateMetadataConfiguration([FromBody, Required] MetadataConfiguration configuration) + public ActionResult UpdateMetadataConfiguration([FromBody, Required] MetadataConfigurationDto configuration) { - _configurationManager.SaveConfiguration("metadata", configuration); + _configurationManager.SaveConfiguration("metadata", MapToInternal(configuration)); return NoContent(); } @@ -159,9 +160,9 @@ public class ConfigurationController : BaseJellyfinApiController /// <returns>XbmcMetadata configuration.</returns> [HttpGet("Configuration/XbmcMetadata")] [ProducesResponseType(StatusCodes.Status200OK)] - public ActionResult<XbmcMetadataOptions> GetXbmcMetadataConfiguration() + public ActionResult<XbmcMetadataOptionsDto> GetXbmcMetadataConfiguration() { - return _configurationManager.GetConfiguration<XbmcMetadataOptions>("xbmcmetadata"); + return MapToDto(_configurationManager.GetConfiguration<XbmcMetadataOptions>("xbmcmetadata")); } /// <summary> @@ -173,9 +174,9 @@ public class ConfigurationController : BaseJellyfinApiController [HttpPost("Configuration/XbmcMetadata")] [Authorize(Policy = Policies.RequiresElevation)] [ProducesResponseType(StatusCodes.Status204NoContent)] - public ActionResult UpdateXbmcMetadataConfiguration([FromBody, Required] XbmcMetadataOptions configuration) + public ActionResult UpdateXbmcMetadataConfiguration([FromBody, Required] XbmcMetadataOptionsDto configuration) { - _configurationManager.SaveConfiguration("xbmcmetadata", configuration); + _configurationManager.SaveConfiguration("xbmcmetadata", MapToInternal(configuration)); return NoContent(); } @@ -186,9 +187,9 @@ public class ConfigurationController : BaseJellyfinApiController /// <returns>LiveTv configuration.</returns> [HttpGet("Configuration/LiveTv")] [ProducesResponseType(StatusCodes.Status200OK)] - public ActionResult<LiveTvOptions> GetLiveTvConfiguration() + public ActionResult<LiveTvOptionsDto> GetLiveTvConfiguration() { - return _configurationManager.GetConfiguration<LiveTvOptions>("livetv"); + return MapToDto(_configurationManager.GetConfiguration<LiveTvOptions>("livetv")); } /// <summary> @@ -200,9 +201,9 @@ public class ConfigurationController : BaseJellyfinApiController [HttpPost("Configuration/LiveTv")] [Authorize(Policy = Policies.RequiresElevation)] [ProducesResponseType(StatusCodes.Status204NoContent)] - public ActionResult UpdateLiveTvConfiguration([FromBody, Required] LiveTvOptions configuration) + public ActionResult UpdateLiveTvConfiguration([FromBody, Required] LiveTvOptionsDto configuration) { - _configurationManager.SaveConfiguration("livetv", configuration); + _configurationManager.SaveConfiguration("livetv", MapToInternal(configuration)); return NoContent(); } @@ -229,4 +230,388 @@ public class ConfigurationController : BaseJellyfinApiController return NoContent(); } + + // Mapping Helpers + + private static ServerConfigurationDto MapToDto(ServerConfiguration config) + { + return new ServerConfigurationDto + { + LogFileRetentionDays = config.LogFileRetentionDays, + IsStartupWizardCompleted = config.IsStartupWizardCompleted, + CachePath = config.CachePath, + PreviousVersionStr = config.PreviousVersionStr, + EnableMetrics = config.EnableMetrics, + EnableNormalizedItemByNameIds = config.EnableNormalizedItemByNameIds, + IsPortAuthorized = config.IsPortAuthorized, + QuickConnectAvailable = config.QuickConnectAvailable, + EnableCaseSensitiveItemIds = config.EnableCaseSensitiveItemIds, + DisableLiveTvChannelUserDataName = config.DisableLiveTvChannelUserDataName, + MetadataPath = config.MetadataPath, + PreferredMetadataLanguage = config.PreferredMetadataLanguage, + MetadataCountryCode = config.MetadataCountryCode, + SortReplaceCharacters = config.SortReplaceCharacters, + SortRemoveCharacters = config.SortRemoveCharacters, + SortRemoveWords = config.SortRemoveWords, + MinResumePct = config.MinResumePct, + MaxResumePct = config.MaxResumePct, + MinResumeDurationSeconds = config.MinResumeDurationSeconds, + MinAudiobookResume = config.MinAudiobookResume, + MaxAudiobookResume = config.MaxAudiobookResume, + InactiveSessionThreshold = config.InactiveSessionThreshold, + LibraryMonitorDelay = config.LibraryMonitorDelay, + LibraryUpdateDuration = config.LibraryUpdateDuration, + CacheSize = config.CacheSize, + ImageSavingConvention = config.ImageSavingConvention, + MetadataOptions = config.MetadataOptions, + SkipDeserializationForBasicTypes = config.SkipDeserializationForBasicTypes, + ServerName = config.ServerName, + UICulture = config.UICulture, + SaveMetadataHidden = config.SaveMetadataHidden, + ContentTypes = config.ContentTypes, + RemoteClientBitrateLimit = config.RemoteClientBitrateLimit, + EnableFolderView = config.EnableFolderView, + EnableGroupingMoviesIntoCollections = config.EnableGroupingMoviesIntoCollections, + EnableGroupingShowsIntoCollections = config.EnableGroupingShowsIntoCollections, + DisplaySpecialsWithinSeasons = config.DisplaySpecialsWithinSeasons, + CodecsUsed = config.CodecsUsed, + PluginRepositories = config.PluginRepositories, + EnableExternalContentInSuggestions = config.EnableExternalContentInSuggestions, + ImageExtractionTimeoutMs = config.ImageExtractionTimeoutMs, + PathSubstitutions = config.PathSubstitutions, + EnableSlowResponseWarning = config.EnableSlowResponseWarning, + SlowResponseThresholdMs = config.SlowResponseThresholdMs, + CorsHosts = config.CorsHosts, + ActivityLogRetentionDays = config.ActivityLogRetentionDays, + LibraryScanFanoutConcurrency = config.LibraryScanFanoutConcurrency, + LibraryMetadataRefreshConcurrency = config.LibraryMetadataRefreshConcurrency, + AllowClientLogUpload = config.AllowClientLogUpload, + DummyChapterDuration = config.DummyChapterDuration, + ChapterImageResolution = config.ChapterImageResolution, + ParallelImageEncodingLimit = config.ParallelImageEncodingLimit, + CastReceiverApplications = config.CastReceiverApplications, + TrickplayOptions = config.TrickplayOptions, + EnableLegacyAuthorization = config.EnableLegacyAuthorization, + }; + } + + private static ServerConfiguration MapToInternal(ServerConfigurationDto dto) + { + return new ServerConfiguration + { + LogFileRetentionDays = dto.LogFileRetentionDays, + IsStartupWizardCompleted = dto.IsStartupWizardCompleted, + CachePath = dto.CachePath, + PreviousVersionStr = dto.PreviousVersionStr, + EnableMetrics = dto.EnableMetrics, + EnableNormalizedItemByNameIds = dto.EnableNormalizedItemByNameIds, + IsPortAuthorized = dto.IsPortAuthorized, + QuickConnectAvailable = dto.QuickConnectAvailable, + EnableCaseSensitiveItemIds = dto.EnableCaseSensitiveItemIds, + DisableLiveTvChannelUserDataName = dto.DisableLiveTvChannelUserDataName, + MetadataPath = dto.MetadataPath, + PreferredMetadataLanguage = dto.PreferredMetadataLanguage, + MetadataCountryCode = dto.MetadataCountryCode, + SortReplaceCharacters = dto.SortReplaceCharacters, + SortRemoveCharacters = dto.SortRemoveCharacters, + SortRemoveWords = dto.SortRemoveWords, + MinResumePct = dto.MinResumePct, + MaxResumePct = dto.MaxResumePct, + MinResumeDurationSeconds = dto.MinResumeDurationSeconds, + MinAudiobookResume = dto.MinAudiobookResume, + MaxAudiobookResume = dto.MaxAudiobookResume, + InactiveSessionThreshold = dto.InactiveSessionThreshold, + LibraryMonitorDelay = dto.LibraryMonitorDelay, + LibraryUpdateDuration = dto.LibraryUpdateDuration, + CacheSize = dto.CacheSize, + ImageSavingConvention = dto.ImageSavingConvention, + MetadataOptions = dto.MetadataOptions, + SkipDeserializationForBasicTypes = dto.SkipDeserializationForBasicTypes, + ServerName = dto.ServerName, + UICulture = dto.UICulture, + SaveMetadataHidden = dto.SaveMetadataHidden, + ContentTypes = dto.ContentTypes, + RemoteClientBitrateLimit = dto.RemoteClientBitrateLimit, + EnableFolderView = dto.EnableFolderView, + EnableGroupingMoviesIntoCollections = dto.EnableGroupingMoviesIntoCollections, + EnableGroupingShowsIntoCollections = dto.EnableGroupingShowsIntoCollections, + DisplaySpecialsWithinSeasons = dto.DisplaySpecialsWithinSeasons, + CodecsUsed = dto.CodecsUsed, + PluginRepositories = dto.PluginRepositories, + EnableExternalContentInSuggestions = dto.EnableExternalContentInSuggestions, + ImageExtractionTimeoutMs = dto.ImageExtractionTimeoutMs, + PathSubstitutions = dto.PathSubstitutions, + EnableSlowResponseWarning = dto.EnableSlowResponseWarning, + SlowResponseThresholdMs = dto.SlowResponseThresholdMs, + CorsHosts = dto.CorsHosts, + ActivityLogRetentionDays = dto.ActivityLogRetentionDays, + LibraryScanFanoutConcurrency = dto.LibraryScanFanoutConcurrency, + LibraryMetadataRefreshConcurrency = dto.LibraryMetadataRefreshConcurrency, + AllowClientLogUpload = dto.AllowClientLogUpload, + DummyChapterDuration = dto.DummyChapterDuration, + ChapterImageResolution = dto.ChapterImageResolution, + ParallelImageEncodingLimit = dto.ParallelImageEncodingLimit, + CastReceiverApplications = dto.CastReceiverApplications, + TrickplayOptions = dto.TrickplayOptions, + EnableLegacyAuthorization = dto.EnableLegacyAuthorization, + }; + } + + private static EncodingOptionsDto MapToDto(EncodingOptions options) + { + return new EncodingOptionsDto + { + EncodingThreadCount = options.EncodingThreadCount, + TranscodingTempPath = options.TranscodingTempPath, + FallbackFontPath = options.FallbackFontPath, + EnableFallbackFont = options.EnableFallbackFont, + EnableAudioVbr = options.EnableAudioVbr, + DownMixAudioBoost = options.DownMixAudioBoost, + DownMixStereoAlgorithm = options.DownMixStereoAlgorithm, + MaxMuxingQueueSize = options.MaxMuxingQueueSize, + EnableThrottling = options.EnableThrottling, + ThrottleDelaySeconds = options.ThrottleDelaySeconds, + EnableSegmentDeletion = options.EnableSegmentDeletion, + SegmentKeepSeconds = options.SegmentKeepSeconds, + HardwareAccelerationType = options.HardwareAccelerationType, + EncoderAppPath = options.EncoderAppPath, + EncoderAppPathDisplay = options.EncoderAppPathDisplay, + VaapiDevice = options.VaapiDevice, + QsvDevice = options.QsvDevice, + EnableTonemapping = options.EnableTonemapping, + EnableVppTonemapping = options.EnableVppTonemapping, + EnableVideoToolboxTonemapping = options.EnableVideoToolboxTonemapping, + TonemappingAlgorithm = options.TonemappingAlgorithm, + TonemappingMode = options.TonemappingMode, + TonemappingRange = options.TonemappingRange, + TonemappingDesat = options.TonemappingDesat, + TonemappingPeak = options.TonemappingPeak, + TonemappingParam = options.TonemappingParam, + VppTonemappingBrightness = options.VppTonemappingBrightness, + VppTonemappingContrast = options.VppTonemappingContrast, + H264Crf = options.H264Crf, + H265Crf = options.H265Crf, + EncoderPreset = options.EncoderPreset, + DeinterlaceDoubleRate = options.DeinterlaceDoubleRate, + DeinterlaceMethod = options.DeinterlaceMethod, + EnableDecodingColorDepth10Hevc = options.EnableDecodingColorDepth10Hevc, + EnableDecodingColorDepth10Vp9 = options.EnableDecodingColorDepth10Vp9, + EnableDecodingColorDepth10HevcRext = options.EnableDecodingColorDepth10HevcRext, + EnableDecodingColorDepth12HevcRext = options.EnableDecodingColorDepth12HevcRext, + EnableEnhancedNvdecDecoder = options.EnableEnhancedNvdecDecoder, + PreferSystemNativeHwDecoder = options.PreferSystemNativeHwDecoder, + EnableIntelLowPowerH264HwEncoder = options.EnableIntelLowPowerH264HwEncoder, + EnableIntelLowPowerHevcHwEncoder = options.EnableIntelLowPowerHevcHwEncoder, + EnableHardwareEncoding = options.EnableHardwareEncoding, + AllowHevcEncoding = options.AllowHevcEncoding, + AllowAv1Encoding = options.AllowAv1Encoding, + EnableSubtitleExtraction = options.EnableSubtitleExtraction, + SubtitleExtractionTimeoutMinutes = options.SubtitleExtractionTimeoutMinutes, + HardwareDecodingCodecs = options.HardwareDecodingCodecs, + AllowOnDemandMetadataBasedKeyframeExtractionForExtensions = options.AllowOnDemandMetadataBasedKeyframeExtractionForExtensions, + HlsAudioSeekStrategy = options.HlsAudioSeekStrategy, + }; + } + + private static EncodingOptions MapToInternal(EncodingOptionsDto dto) + { + return new EncodingOptions + { + EncodingThreadCount = dto.EncodingThreadCount, + TranscodingTempPath = dto.TranscodingTempPath, + FallbackFontPath = dto.FallbackFontPath, + EnableFallbackFont = dto.EnableFallbackFont, + EnableAudioVbr = dto.EnableAudioVbr, + DownMixAudioBoost = dto.DownMixAudioBoost, + DownMixStereoAlgorithm = dto.DownMixStereoAlgorithm, + MaxMuxingQueueSize = dto.MaxMuxingQueueSize, + EnableThrottling = dto.EnableThrottling, + ThrottleDelaySeconds = dto.ThrottleDelaySeconds, + EnableSegmentDeletion = dto.EnableSegmentDeletion, + SegmentKeepSeconds = dto.SegmentKeepSeconds, + HardwareAccelerationType = dto.HardwareAccelerationType, + EncoderAppPath = dto.EncoderAppPath, + EncoderAppPathDisplay = dto.EncoderAppPathDisplay, + VaapiDevice = dto.VaapiDevice, + QsvDevice = dto.QsvDevice, + EnableTonemapping = dto.EnableTonemapping, + EnableVppTonemapping = dto.EnableVppTonemapping, + EnableVideoToolboxTonemapping = dto.EnableVideoToolboxTonemapping, + TonemappingAlgorithm = dto.TonemappingAlgorithm, + TonemappingMode = dto.TonemappingMode, + TonemappingRange = dto.TonemappingRange, + TonemappingDesat = dto.TonemappingDesat, + TonemappingPeak = dto.TonemappingPeak, + TonemappingParam = dto.TonemappingParam, + VppTonemappingBrightness = dto.VppTonemappingBrightness, + VppTonemappingContrast = dto.VppTonemappingContrast, + H264Crf = dto.H264Crf, + H265Crf = dto.H265Crf, + EncoderPreset = dto.EncoderPreset, + DeinterlaceDoubleRate = dto.DeinterlaceDoubleRate, + DeinterlaceMethod = dto.DeinterlaceMethod, + EnableDecodingColorDepth10Hevc = dto.EnableDecodingColorDepth10Hevc, + EnableDecodingColorDepth10Vp9 = dto.EnableDecodingColorDepth10Vp9, + EnableDecodingColorDepth10HevcRext = dto.EnableDecodingColorDepth10HevcRext, + EnableDecodingColorDepth12HevcRext = dto.EnableDecodingColorDepth12HevcRext, + EnableEnhancedNvdecDecoder = dto.EnableEnhancedNvdecDecoder, + PreferSystemNativeHwDecoder = dto.PreferSystemNativeHwDecoder, + EnableIntelLowPowerH264HwEncoder = dto.EnableIntelLowPowerH264HwEncoder, + EnableIntelLowPowerHevcHwEncoder = dto.EnableIntelLowPowerHevcHwEncoder, + EnableHardwareEncoding = dto.EnableHardwareEncoding, + AllowHevcEncoding = dto.AllowHevcEncoding, + AllowAv1Encoding = dto.AllowAv1Encoding, + EnableSubtitleExtraction = dto.EnableSubtitleExtraction, + SubtitleExtractionTimeoutMinutes = dto.SubtitleExtractionTimeoutMinutes, + HardwareDecodingCodecs = dto.HardwareDecodingCodecs, + AllowOnDemandMetadataBasedKeyframeExtractionForExtensions = dto.AllowOnDemandMetadataBasedKeyframeExtractionForExtensions, + HlsAudioSeekStrategy = dto.HlsAudioSeekStrategy, + }; + } + +#pragma warning disable CS0618 // Type or member is obsolete + private static NetworkConfigurationDto MapToDto(NetworkConfiguration config) + { + return new NetworkConfigurationDto + { + BaseUrl = config.BaseUrl, + EnableHttps = config.EnableHttps, + RequireHttps = config.RequireHttps, + CertificatePath = config.CertificatePath, + CertificatePassword = config.CertificatePassword, + InternalHttpPort = config.InternalHttpPort, + InternalHttpsPort = config.InternalHttpsPort, + PublicHttpPort = config.PublicHttpPort, + PublicHttpsPort = config.PublicHttpsPort, + AutoDiscovery = config.AutoDiscovery, + EnableUPnP = config.EnableUPnP, + EnableIPv4 = config.EnableIPv4, + EnableIPv6 = config.EnableIPv6, + EnableRemoteAccess = config.EnableRemoteAccess, + LocalNetworkSubnets = config.LocalNetworkSubnets, + LocalNetworkAddresses = config.LocalNetworkAddresses, + KnownProxies = config.KnownProxies, + IgnoreVirtualInterfaces = config.IgnoreVirtualInterfaces, + VirtualInterfaceNames = config.VirtualInterfaceNames, + EnablePublishedServerUriByRequest = config.EnablePublishedServerUriByRequest, + PublishedServerUriBySubnet = config.PublishedServerUriBySubnet, + RemoteIPFilter = config.RemoteIPFilter, + IsRemoteIPFilterBlacklist = config.IsRemoteIPFilterBlacklist, + }; + } + + private static NetworkConfiguration MapToInternal(NetworkConfigurationDto dto) + { + return new NetworkConfiguration + { + BaseUrl = dto.BaseUrl, + EnableHttps = dto.EnableHttps, + RequireHttps = dto.RequireHttps, + CertificatePath = dto.CertificatePath, + CertificatePassword = dto.CertificatePassword, + InternalHttpPort = dto.InternalHttpPort, + InternalHttpsPort = dto.InternalHttpsPort, + PublicHttpPort = dto.PublicHttpPort, + PublicHttpsPort = dto.PublicHttpsPort, + AutoDiscovery = dto.AutoDiscovery, + EnableUPnP = dto.EnableUPnP, + EnableIPv4 = dto.EnableIPv4, + EnableIPv6 = dto.EnableIPv6, + EnableRemoteAccess = dto.EnableRemoteAccess, + LocalNetworkSubnets = dto.LocalNetworkSubnets, + LocalNetworkAddresses = dto.LocalNetworkAddresses, + KnownProxies = dto.KnownProxies, + IgnoreVirtualInterfaces = dto.IgnoreVirtualInterfaces, + VirtualInterfaceNames = dto.VirtualInterfaceNames, + EnablePublishedServerUriByRequest = dto.EnablePublishedServerUriByRequest, + PublishedServerUriBySubnet = dto.PublishedServerUriBySubnet, + RemoteIPFilter = dto.RemoteIPFilter, + IsRemoteIPFilterBlacklist = dto.IsRemoteIPFilterBlacklist, + }; + } +#pragma warning restore CS0618 // Type or member is obsolete + + private static MetadataConfigurationDto MapToDto(MetadataConfiguration config) + { + return new MetadataConfigurationDto + { + UseFileCreationTimeForDateAdded = config.UseFileCreationTimeForDateAdded, + }; + } + + private static MetadataConfiguration MapToInternal(MetadataConfigurationDto dto) + { + return new MetadataConfiguration + { + UseFileCreationTimeForDateAdded = dto.UseFileCreationTimeForDateAdded, + }; + } + + private static XbmcMetadataOptionsDto MapToDto(XbmcMetadataOptions config) + { + return new XbmcMetadataOptionsDto + { + UserId = config.UserId, + ReleaseDateFormat = config.ReleaseDateFormat, + SaveImagePathsInNfo = config.SaveImagePathsInNfo, + EnablePathSubstitution = config.EnablePathSubstitution, + EnableExtraThumbsDuplication = config.EnableExtraThumbsDuplication, + }; + } + + private static XbmcMetadataOptions MapToInternal(XbmcMetadataOptionsDto dto) + { + return new XbmcMetadataOptions + { + UserId = dto.UserId, + ReleaseDateFormat = dto.ReleaseDateFormat, + SaveImagePathsInNfo = dto.SaveImagePathsInNfo, + EnablePathSubstitution = dto.EnablePathSubstitution, + EnableExtraThumbsDuplication = dto.EnableExtraThumbsDuplication, + }; + } + + private static LiveTvOptionsDto MapToDto(LiveTvOptions config) + { + return new LiveTvOptionsDto + { + GuideDays = config.GuideDays, + RecordingPath = config.RecordingPath, + MovieRecordingPath = config.MovieRecordingPath, + SeriesRecordingPath = config.SeriesRecordingPath, + EnableRecordingSubfolders = config.EnableRecordingSubfolders, + EnableOriginalAudioWithEncodedRecordings = config.EnableOriginalAudioWithEncodedRecordings, + TunerHosts = config.TunerHosts, + ListingProviders = config.ListingProviders, + PrePaddingSeconds = config.PrePaddingSeconds, + PostPaddingSeconds = config.PostPaddingSeconds, + MediaLocationsCreated = config.MediaLocationsCreated, + RecordingPostProcessor = config.RecordingPostProcessor, + RecordingPostProcessorArguments = config.RecordingPostProcessorArguments, + SaveRecordingNFO = config.SaveRecordingNFO, + SaveRecordingImages = config.SaveRecordingImages, + }; + } + + private static LiveTvOptions MapToInternal(LiveTvOptionsDto dto) + { + return new LiveTvOptions + { + GuideDays = dto.GuideDays, + RecordingPath = dto.RecordingPath, + MovieRecordingPath = dto.MovieRecordingPath, + SeriesRecordingPath = dto.SeriesRecordingPath, + EnableRecordingSubfolders = dto.EnableRecordingSubfolders, + EnableOriginalAudioWithEncodedRecordings = dto.EnableOriginalAudioWithEncodedRecordings, + TunerHosts = dto.TunerHosts, + ListingProviders = dto.ListingProviders, + PrePaddingSeconds = dto.PrePaddingSeconds, + PostPaddingSeconds = dto.PostPaddingSeconds, + MediaLocationsCreated = dto.MediaLocationsCreated, + RecordingPostProcessor = dto.RecordingPostProcessor, + RecordingPostProcessorArguments = dto.RecordingPostProcessorArguments, + SaveRecordingNFO = dto.SaveRecordingNFO, + SaveRecordingImages = dto.SaveRecordingImages, + }; + } } diff --git a/MediaBrowser.Common/Net/NetworkConfigurationDto.cs b/MediaBrowser.Common/Net/NetworkConfigurationDto.cs new file mode 100644 index 0000000000..5726b92728 --- /dev/null +++ b/MediaBrowser.Common/Net/NetworkConfigurationDto.cs @@ -0,0 +1,126 @@ +#pragma warning disable CA1819 + +using System; + +namespace MediaBrowser.Common.Net; + +/// <summary> +/// The network configuration DTO for API use. +/// </summary> +public class NetworkConfigurationDto +{ + /// <summary> + /// Gets or sets a value used to specify the URL prefix that your Jellyfin instance can be accessed at. + /// </summary> + public string BaseUrl { get; set; } = string.Empty; + + /// <summary> + /// Gets or sets a value indicating whether to use HTTPS. + /// </summary> + public bool EnableHttps { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether the server should force connections over HTTPS. + /// </summary> + public bool RequireHttps { get; set; } + + /// <summary> + /// Gets or sets the filesystem path of an X.509 certificate to use for SSL. + /// </summary> + public string CertificatePath { get; set; } = string.Empty; + + /// <summary> + /// Gets or sets the password required to access the X.509 certificate data in the file specified by <see cref="CertificatePath"/>. + /// </summary> + public string CertificatePassword { get; set; } = string.Empty; + + /// <summary> + /// Gets or sets the internal HTTP server port. + /// </summary> + public int InternalHttpPort { get; set; } = NetworkConfiguration.DefaultHttpPort; + + /// <summary> + /// Gets or sets the internal HTTPS server port. + /// </summary> + public int InternalHttpsPort { get; set; } = NetworkConfiguration.DefaultHttpsPort; + + /// <summary> + /// Gets or sets the public HTTP port. + /// </summary> + public int PublicHttpPort { get; set; } = NetworkConfiguration.DefaultHttpPort; + + /// <summary> + /// Gets or sets the public HTTPS port. + /// </summary> + public int PublicHttpsPort { get; set; } = NetworkConfiguration.DefaultHttpsPort; + + /// <summary> + /// Gets or sets a value indicating whether Autodiscovery is enabled. + /// </summary> + public bool AutoDiscovery { get; set; } = true; + + /// <summary> + /// Gets or sets a value indicating whether to enable automatic port forwarding. + /// </summary> + public bool EnableUPnP { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether IPv4 is enabled. + /// </summary> + public bool EnableIPv4 { get; set; } = true; + + /// <summary> + /// Gets or sets a value indicating whether IPv6 is enabled. + /// </summary> + public bool EnableIPv6 { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether access from outside of the LAN is permitted. + /// </summary> + public bool EnableRemoteAccess { get; set; } = true; + + /// <summary> + /// Gets or sets the subnets that are deemed to make up the LAN. + /// </summary> + public string[] LocalNetworkSubnets { get; set; } = Array.Empty<string>(); + + /// <summary> + /// Gets or sets the interface addresses which Jellyfin will bind to. If empty, all interfaces will be used. + /// </summary> + public string[] LocalNetworkAddresses { get; set; } = Array.Empty<string>(); + + /// <summary> + /// Gets or sets the known proxies. + /// </summary> + public string[] KnownProxies { get; set; } = Array.Empty<string>(); + + /// <summary> + /// Gets or sets a value indicating whether address names that match <see cref="VirtualInterfaceNames"/> should be ignored for the purposes of binding. + /// </summary> + public bool IgnoreVirtualInterfaces { get; set; } = true; + + /// <summary> + /// Gets or sets a value indicating the interface name prefixes that should be ignored. + /// </summary> + public string[] VirtualInterfaceNames { get; set; } = new string[] { "veth" }; + + /// <summary> + /// Gets or sets a value indicating whether the published server uri is based on information in HTTP requests. + /// </summary> + public bool EnablePublishedServerUriByRequest { get; set; } = false; + + /// <summary> + /// Gets or sets PublishedServerUri to advertise for specific subnets. + /// </summary> + public string[] PublishedServerUriBySubnet { get; set; } = Array.Empty<string>(); + + /// <summary> + /// Gets or sets the filter for remote IP connectivity. Used in conjunction with <seealso cref="IsRemoteIPFilterBlacklist"/>. + /// </summary> + public string[] RemoteIPFilter { get; set; } = Array.Empty<string>(); + + /// <summary> + /// Gets or sets a value indicating whether <seealso cref="RemoteIPFilter"/> contains a blacklist or a whitelist. Default is a whitelist. + /// </summary> + public bool IsRemoteIPFilterBlacklist { get; set; } +} diff --git a/MediaBrowser.Model/Configuration/EncodingOptionsDto.cs b/MediaBrowser.Model/Configuration/EncodingOptionsDto.cs new file mode 100644 index 0000000000..755ba577ca --- /dev/null +++ b/MediaBrowser.Model/Configuration/EncodingOptionsDto.cs @@ -0,0 +1,309 @@ +#pragma warning disable CA1819 + +#nullable disable +using System.ComponentModel; +using MediaBrowser.Model.Entities; + +namespace MediaBrowser.Model.Configuration; + +/// <summary> +/// The encoding options DTO for API use. +/// </summary> +public class EncodingOptionsDto +{ + /// <summary> + /// Initializes a new instance of the <see cref="EncodingOptionsDto" /> class. + /// </summary> + public EncodingOptionsDto() + { + EnableFallbackFont = false; + EnableAudioVbr = false; + DownMixAudioBoost = 2; + DownMixStereoAlgorithm = DownMixStereoAlgorithms.None; + MaxMuxingQueueSize = 2048; + EnableThrottling = false; + ThrottleDelaySeconds = 180; + EnableSegmentDeletion = false; + SegmentKeepSeconds = 720; + EncodingThreadCount = -1; + VaapiDevice = "/dev/dri/renderD128"; + QsvDevice = string.Empty; + EnableTonemapping = false; + EnableVppTonemapping = false; + EnableVideoToolboxTonemapping = false; + TonemappingAlgorithm = TonemappingAlgorithm.bt2390; + TonemappingMode = TonemappingMode.auto; + TonemappingRange = TonemappingRange.auto; + TonemappingDesat = 0; + TonemappingPeak = 100; + TonemappingParam = 0; + VppTonemappingBrightness = 16; + VppTonemappingContrast = 1; + H264Crf = 23; + H265Crf = 28; + DeinterlaceDoubleRate = false; + DeinterlaceMethod = DeinterlaceMethod.yadif; + EnableDecodingColorDepth10Hevc = true; + EnableDecodingColorDepth10Vp9 = true; + EnableDecodingColorDepth10HevcRext = false; + EnableDecodingColorDepth12HevcRext = false; + EnableEnhancedNvdecDecoder = true; + PreferSystemNativeHwDecoder = true; + EnableIntelLowPowerH264HwEncoder = false; + EnableIntelLowPowerHevcHwEncoder = false; + EnableHardwareEncoding = true; + AllowHevcEncoding = false; + AllowAv1Encoding = false; + EnableSubtitleExtraction = true; + SubtitleExtractionTimeoutMinutes = 30; + AllowOnDemandMetadataBasedKeyframeExtractionForExtensions = ["mkv"]; + HardwareDecodingCodecs = ["h264", "vc1"]; + HlsAudioSeekStrategy = HlsAudioSeekStrategy.DisableAccurateSeek; + } + + /// <summary> + /// Gets or sets the thread count used for encoding. + /// </summary> + public int EncodingThreadCount { get; set; } + + /// <summary> + /// Gets or sets the temporary transcoding path. + /// </summary> + public string TranscodingTempPath { get; set; } + + /// <summary> + /// Gets or sets the path to the fallback font. + /// </summary> + public string FallbackFontPath { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether to use the fallback font. + /// </summary> + public bool EnableFallbackFont { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether audio VBR is enabled. + /// </summary> + public bool EnableAudioVbr { get; set; } + + /// <summary> + /// Gets or sets the audio boost applied when downmixing audio. + /// </summary> + public double DownMixAudioBoost { get; set; } + + /// <summary> + /// Gets or sets the algorithm used for downmixing audio to stereo. + /// </summary> + public DownMixStereoAlgorithms DownMixStereoAlgorithm { get; set; } + + /// <summary> + /// Gets or sets the maximum size of the muxing queue. + /// </summary> + public int MaxMuxingQueueSize { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether throttling is enabled. + /// </summary> + public bool EnableThrottling { get; set; } + + /// <summary> + /// Gets or sets the delay after which throttling happens. + /// </summary> + public int ThrottleDelaySeconds { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether segment deletion is enabled. + /// </summary> + public bool EnableSegmentDeletion { get; set; } + + /// <summary> + /// Gets or sets seconds for which segments should be kept before being deleted. + /// </summary> + public int SegmentKeepSeconds { get; set; } + + /// <summary> + /// Gets or sets the hardware acceleration type. + /// </summary> + public HardwareAccelerationType HardwareAccelerationType { get; set; } + + /// <summary> + /// Gets or sets the FFmpeg path as set by the user via the UI. + /// </summary> + public string EncoderAppPath { get; set; } + + /// <summary> + /// Gets or sets the current FFmpeg path being used by the system and displayed on the transcode page. + /// </summary> + public string EncoderAppPathDisplay { get; set; } + + /// <summary> + /// Gets or sets the VA-API device. + /// </summary> + public string VaapiDevice { get; set; } + + /// <summary> + /// Gets or sets the QSV device. + /// </summary> + public string QsvDevice { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether tonemapping is enabled. + /// </summary> + public bool EnableTonemapping { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether VPP tonemapping is enabled. + /// </summary> + public bool EnableVppTonemapping { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether videotoolbox tonemapping is enabled. + /// </summary> + public bool EnableVideoToolboxTonemapping { get; set; } + + /// <summary> + /// Gets or sets the tone-mapping algorithm. + /// </summary> + public TonemappingAlgorithm TonemappingAlgorithm { get; set; } + + /// <summary> + /// Gets or sets the tone-mapping mode. + /// </summary> + public TonemappingMode TonemappingMode { get; set; } + + /// <summary> + /// Gets or sets the tone-mapping range. + /// </summary> + public TonemappingRange TonemappingRange { get; set; } + + /// <summary> + /// Gets or sets the tone-mapping desaturation. + /// </summary> + public double TonemappingDesat { get; set; } + + /// <summary> + /// Gets or sets the tone-mapping peak. + /// </summary> + public double TonemappingPeak { get; set; } + + /// <summary> + /// Gets or sets the tone-mapping parameters. + /// </summary> + public double TonemappingParam { get; set; } + + /// <summary> + /// Gets or sets the VPP tone-mapping brightness. + /// </summary> + public double VppTonemappingBrightness { get; set; } + + /// <summary> + /// Gets or sets the VPP tone-mapping contrast. + /// </summary> + public double VppTonemappingContrast { get; set; } + + /// <summary> + /// Gets or sets the H264 CRF. + /// </summary> + public int H264Crf { get; set; } + + /// <summary> + /// Gets or sets the H265 CRF. + /// </summary> + public int H265Crf { get; set; } + + /// <summary> + /// Gets or sets the encoder preset. + /// </summary> + public EncoderPreset? EncoderPreset { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether the framerate is doubled when deinterlacing. + /// </summary> + public bool DeinterlaceDoubleRate { get; set; } + + /// <summary> + /// Gets or sets the deinterlace method. + /// </summary> + public DeinterlaceMethod DeinterlaceMethod { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether 10bit HEVC decoding is enabled. + /// </summary> + public bool EnableDecodingColorDepth10Hevc { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether 10bit VP9 decoding is enabled. + /// </summary> + public bool EnableDecodingColorDepth10Vp9 { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether 8/10bit HEVC RExt decoding is enabled. + /// </summary> + public bool EnableDecodingColorDepth10HevcRext { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether 12bit HEVC RExt decoding is enabled. + /// </summary> + public bool EnableDecodingColorDepth12HevcRext { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether the enhanced NVDEC is enabled. + /// </summary> + public bool EnableEnhancedNvdecDecoder { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether the system native hardware decoder should be used. + /// </summary> + public bool PreferSystemNativeHwDecoder { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether the Intel H264 low-power hardware encoder should be used. + /// </summary> + public bool EnableIntelLowPowerH264HwEncoder { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether the Intel HEVC low-power hardware encoder should be used. + /// </summary> + public bool EnableIntelLowPowerHevcHwEncoder { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether hardware encoding is enabled. + /// </summary> + public bool EnableHardwareEncoding { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether HEVC encoding is enabled. + /// </summary> + public bool AllowHevcEncoding { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether AV1 encoding is enabled. + /// </summary> + public bool AllowAv1Encoding { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether subtitle extraction is enabled. + /// </summary> + public bool EnableSubtitleExtraction { get; set; } + + /// <summary> + /// Gets or sets the timeout for subtitle extraction in minutes. + /// </summary> + public int SubtitleExtractionTimeoutMinutes { get; set; } + + /// <summary> + /// Gets or sets the codecs hardware encoding is used for. + /// </summary> + public string[] HardwareDecodingCodecs { get; set; } + + /// <summary> + /// Gets or sets the file extensions on-demand metadata based keyframe extraction is enabled for. + /// </summary> + public string[] AllowOnDemandMetadataBasedKeyframeExtractionForExtensions { get; set; } + + /// <summary> + /// Gets or sets the method used for audio seeking in HLS. + /// </summary> + [DefaultValue(HlsAudioSeekStrategy.DisableAccurateSeek)] + public HlsAudioSeekStrategy HlsAudioSeekStrategy { get; set; } +} diff --git a/MediaBrowser.Model/Configuration/MetadataConfigurationDto.cs b/MediaBrowser.Model/Configuration/MetadataConfigurationDto.cs new file mode 100644 index 0000000000..8b39523bc7 --- /dev/null +++ b/MediaBrowser.Model/Configuration/MetadataConfigurationDto.cs @@ -0,0 +1,12 @@ +namespace MediaBrowser.Model.Configuration; + +/// <summary> +/// The metadata configuration DTO for API use. +/// </summary> +public class MetadataConfigurationDto +{ + /// <summary> + /// Gets or sets a value indicating whether to use file creation time for date added. + /// </summary> + public bool UseFileCreationTimeForDateAdded { get; set; } = true; +} diff --git a/MediaBrowser.Model/Configuration/ServerConfigurationDto.cs b/MediaBrowser.Model/Configuration/ServerConfigurationDto.cs new file mode 100644 index 0000000000..62af8b9626 --- /dev/null +++ b/MediaBrowser.Model/Configuration/ServerConfigurationDto.cs @@ -0,0 +1,177 @@ +#pragma warning disable CS1591 +#pragma warning disable CA1819 + +using System; +using MediaBrowser.Model.Drawing; +using MediaBrowser.Model.Dto; +using MediaBrowser.Model.System; +using MediaBrowser.Model.Updates; + +namespace MediaBrowser.Model.Configuration; + +/// <summary> +/// The server configuration DTO for API use. +/// </summary> +public class ServerConfigurationDto +{ + /// <summary> + /// Initializes a new instance of the <see cref="ServerConfigurationDto" /> class. + /// </summary> + public ServerConfigurationDto() + { + LogFileRetentionDays = 3; + MetadataOptions = new[] + { + new MetadataOptions() + { + ItemType = "Book" + }, + new MetadataOptions() + { + ItemType = "Movie" + }, + new MetadataOptions + { + ItemType = "MusicVideo", + DisabledMetadataFetchers = new[] { "The Open Movie Database" }, + DisabledImageFetchers = new[] { "The Open Movie Database" } + }, + new MetadataOptions + { + ItemType = "Series", + }, + new MetadataOptions + { + ItemType = "MusicAlbum", + DisabledMetadataFetchers = new[] { "TheAudioDB" } + }, + new MetadataOptions + { + ItemType = "MusicArtist", + DisabledMetadataFetchers = new[] { "TheAudioDB" } + }, + new MetadataOptions + { + ItemType = "BoxSet" + }, + new MetadataOptions + { + ItemType = "Season", + }, + new MetadataOptions + { + ItemType = "Episode", + } + }; + } + + public int LogFileRetentionDays { get; set; } + + public bool IsStartupWizardCompleted { get; set; } + + public string? CachePath { get; set; } + + public string? PreviousVersionStr { get; set; } + + public bool EnableMetrics { get; set; } = false; + + public bool EnableNormalizedItemByNameIds { get; set; } = true; + + public bool IsPortAuthorized { get; set; } + + public bool QuickConnectAvailable { get; set; } = true; + + public bool EnableCaseSensitiveItemIds { get; set; } = true; + + public bool DisableLiveTvChannelUserDataName { get; set; } = true; + + public string MetadataPath { get; set; } = string.Empty; + + public string PreferredMetadataLanguage { get; set; } = "en"; + + public string MetadataCountryCode { get; set; } = "US"; + + public string[] SortReplaceCharacters { get; set; } = new[] { ".", "+", "%" }; + + public string[] SortRemoveCharacters { get; set; } = new[] { ",", "&", "-", "{", "}", "'" }; + + public string[] SortRemoveWords { get; set; } = new[] { "the", "a", "an" }; + + public int MinResumePct { get; set; } = 5; + + public int MaxResumePct { get; set; } = 90; + + public int MinResumeDurationSeconds { get; set; } = 300; + + public int MinAudiobookResume { get; set; } = 5; + + public int MaxAudiobookResume { get; set; } = 5; + + public int InactiveSessionThreshold { get; set; } + + public int LibraryMonitorDelay { get; set; } = 60; + + public int LibraryUpdateDuration { get; set; } = 30; + + public int CacheSize { get; set; } = Environment.ProcessorCount * 100; + + public ImageSavingConvention ImageSavingConvention { get; set; } + + public MetadataOptions[] MetadataOptions { get; set; } + + public bool SkipDeserializationForBasicTypes { get; set; } = true; + + public string ServerName { get; set; } = string.Empty; + + public string UICulture { get; set; } = "en-US"; + + public bool SaveMetadataHidden { get; set; } = false; + + public NameValuePair[] ContentTypes { get; set; } = Array.Empty<NameValuePair>(); + + public int RemoteClientBitrateLimit { get; set; } + + public bool EnableFolderView { get; set; } = false; + + public bool EnableGroupingMoviesIntoCollections { get; set; } = false; + + public bool EnableGroupingShowsIntoCollections { get; set; } = false; + + public bool DisplaySpecialsWithinSeasons { get; set; } = true; + + public string[] CodecsUsed { get; set; } = Array.Empty<string>(); + + public RepositoryInfo[] PluginRepositories { get; set; } = Array.Empty<RepositoryInfo>(); + + public bool EnableExternalContentInSuggestions { get; set; } = true; + + public int ImageExtractionTimeoutMs { get; set; } + + public PathSubstitution[] PathSubstitutions { get; set; } = Array.Empty<PathSubstitution>(); + + public bool EnableSlowResponseWarning { get; set; } = true; + + public long SlowResponseThresholdMs { get; set; } = 500; + + public string[] CorsHosts { get; set; } = new[] { "*" }; + + public int? ActivityLogRetentionDays { get; set; } = 30; + + public int LibraryScanFanoutConcurrency { get; set; } + + public int LibraryMetadataRefreshConcurrency { get; set; } + + public bool AllowClientLogUpload { get; set; } = true; + + public int DummyChapterDuration { get; set; } + + public ImageResolution ChapterImageResolution { get; set; } = ImageResolution.MatchSource; + + public int ParallelImageEncodingLimit { get; set; } + + public CastReceiverApplication[] CastReceiverApplications { get; set; } = Array.Empty<CastReceiverApplication>(); + + public TrickplayOptions TrickplayOptions { get; set; } = new TrickplayOptions(); + + public bool EnableLegacyAuthorization { get; set; } +} diff --git a/MediaBrowser.Model/Configuration/XbmcMetadataOptionsDto.cs b/MediaBrowser.Model/Configuration/XbmcMetadataOptionsDto.cs new file mode 100644 index 0000000000..ba27381dae --- /dev/null +++ b/MediaBrowser.Model/Configuration/XbmcMetadataOptionsDto.cs @@ -0,0 +1,32 @@ +namespace MediaBrowser.Model.Configuration; + +/// <summary> +/// The XBMC metadata options DTO for API use. +/// </summary> +public class XbmcMetadataOptionsDto +{ + /// <summary> + /// Gets or sets the user id. + /// </summary> + public string? UserId { get; set; } + + /// <summary> + /// Gets or sets the release date format. + /// </summary> + public string ReleaseDateFormat { get; set; } = "yyyy-MM-dd"; + + /// <summary> + /// Gets or sets a value indicating whether to save image paths in NFO. + /// </summary> + public bool SaveImagePathsInNfo { get; set; } = true; + + /// <summary> + /// Gets or sets a value indicating whether to enable path substitution. + /// </summary> + public bool EnablePathSubstitution { get; set; } = true; + + /// <summary> + /// Gets or sets a value indicating whether to enable extra thumbs duplication. + /// </summary> + public bool EnableExtraThumbsDuplication { get; set; } +} diff --git a/MediaBrowser.Model/LiveTv/LiveTvOptionsDto.cs b/MediaBrowser.Model/LiveTv/LiveTvOptionsDto.cs new file mode 100644 index 0000000000..923128d999 --- /dev/null +++ b/MediaBrowser.Model/LiveTv/LiveTvOptionsDto.cs @@ -0,0 +1,97 @@ +#pragma warning disable CA1819 + +using System; + +namespace MediaBrowser.Model.LiveTv; + +/// <summary> +/// The LiveTV options DTO for API use. +/// </summary> +public class LiveTvOptionsDto +{ + /// <summary> + /// Initializes a new instance of the <see cref="LiveTvOptionsDto" /> class. + /// </summary> + public LiveTvOptionsDto() + { + TunerHosts = Array.Empty<TunerHostInfo>(); + ListingProviders = Array.Empty<ListingsProviderInfo>(); + MediaLocationsCreated = Array.Empty<string>(); + RecordingPostProcessorArguments = "\"{path}\""; + } + + /// <summary> + /// Gets or sets the guide days. + /// </summary> + public int? GuideDays { get; set; } + + /// <summary> + /// Gets or sets the recording path. + /// </summary> + public string? RecordingPath { get; set; } + + /// <summary> + /// Gets or sets the movie recording path. + /// </summary> + public string? MovieRecordingPath { get; set; } + + /// <summary> + /// Gets or sets the series recording path. + /// </summary> + public string? SeriesRecordingPath { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether to enable recording subfolders. + /// </summary> + public bool EnableRecordingSubfolders { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether to enable original audio with encoded recordings. + /// </summary> + public bool EnableOriginalAudioWithEncodedRecordings { get; set; } + + /// <summary> + /// Gets or sets the tuner hosts. + /// </summary> + public TunerHostInfo[] TunerHosts { get; set; } + + /// <summary> + /// Gets or sets the listing providers. + /// </summary> + public ListingsProviderInfo[] ListingProviders { get; set; } + + /// <summary> + /// Gets or sets the pre-padding seconds. + /// </summary> + public int PrePaddingSeconds { get; set; } + + /// <summary> + /// Gets or sets the post-padding seconds. + /// </summary> + public int PostPaddingSeconds { get; set; } + + /// <summary> + /// Gets or sets the media locations created. + /// </summary> + public string[] MediaLocationsCreated { get; set; } + + /// <summary> + /// Gets or sets the recording post processor. + /// </summary> + public string? RecordingPostProcessor { get; set; } + + /// <summary> + /// Gets or sets the recording post processor arguments. + /// </summary> + public string RecordingPostProcessorArguments { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether to save recording NFO. + /// </summary> + public bool SaveRecordingNFO { get; set; } = true; + + /// <summary> + /// Gets or sets a value indicating whether to save recording images. + /// </summary> + public bool SaveRecordingImages { get; set; } = true; +} |
