repo creation with initial code after cloning public repo
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace MediaBrowser.Model.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// Serves as a common base class for the Server and UI application Configurations
|
||||
/// ProtoInclude tells Protobuf about subclasses,
|
||||
/// The number 50 can be any number, so long as it doesn't clash with any of the ProtoMember numbers either here or in subclasses.
|
||||
/// </summary>
|
||||
public class BaseApplicationConfiguration
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="BaseApplicationConfiguration" /> class.
|
||||
/// </summary>
|
||||
public BaseApplicationConfiguration()
|
||||
{
|
||||
LogFileRetentionDays = 3;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the number of days we should retain log files.
|
||||
/// </summary>
|
||||
/// <value>The log file retention days.</value>
|
||||
public int LogFileRetentionDays { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this instance is first run.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is first run; otherwise, <c>false</c>.</value>
|
||||
public bool IsStartupWizardCompleted { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the cache path.
|
||||
/// </summary>
|
||||
/// <value>The cache path.</value>
|
||||
public string? CachePath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the last known version that was ran using the configuration.
|
||||
/// </summary>
|
||||
/// <value>The version from previous run.</value>
|
||||
[XmlIgnore]
|
||||
public Version? PreviousVersion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the stringified PreviousVersion to be stored/loaded,
|
||||
/// because System.Version itself isn't xml-serializable.
|
||||
/// </summary>
|
||||
/// <value>String value of PreviousVersion.</value>
|
||||
public string? PreviousVersionStr
|
||||
{
|
||||
get => PreviousVersion?.ToString();
|
||||
set
|
||||
{
|
||||
if (Version.TryParse(value, out var version))
|
||||
{
|
||||
PreviousVersion = version;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
namespace MediaBrowser.Model.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// An enum representing the options to disable embedded subs.
|
||||
/// </summary>
|
||||
public enum EmbeddedSubtitleOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Allow all embedded subs.
|
||||
/// </summary>
|
||||
AllowAll = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Allow only embedded subs that are text based.
|
||||
/// </summary>
|
||||
AllowText = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Allow only embedded subs that are image based.
|
||||
/// </summary>
|
||||
AllowImage = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Disable all embedded subs.
|
||||
/// </summary>
|
||||
AllowNone = 3,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,312 @@
|
||||
#pragma warning disable CA1819 // XML serialization handles collections improperly, so we need to use arrays
|
||||
|
||||
#nullable disable
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Entities;
|
||||
|
||||
namespace MediaBrowser.Model.Configuration;
|
||||
|
||||
/// <summary>
|
||||
/// Class EncodingOptions.
|
||||
/// </summary>
|
||||
public class EncodingOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="EncodingOptions" /> class.
|
||||
/// </summary>
|
||||
public EncodingOptions()
|
||||
{
|
||||
EnableFallbackFont = false;
|
||||
EnableAudioVbr = false;
|
||||
DownMixAudioBoost = 2;
|
||||
DownMixStereoAlgorithm = DownMixStereoAlgorithms.None;
|
||||
MaxMuxingQueueSize = 2048;
|
||||
EnableThrottling = false;
|
||||
ThrottleDelaySeconds = 180;
|
||||
EnableSegmentDeletion = false;
|
||||
SegmentKeepSeconds = 720;
|
||||
EncodingThreadCount = -1;
|
||||
// This is a DRM device that is almost guaranteed to be there on every intel platform,
|
||||
// plus it's the default one in ffmpeg if you don't specify anything
|
||||
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;
|
||||
// Enhanced Nvdec or system native decoder is required for DoVi to SDR tone-mapping.
|
||||
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; }
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
namespace MediaBrowser.Model.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// An enum representing the options to seek the input audio stream when
|
||||
/// transcoding HLS segments.
|
||||
/// </summary>
|
||||
public enum HlsAudioSeekStrategy
|
||||
{
|
||||
/// <summary>
|
||||
/// If the video stream is transcoded and the audio stream is copied,
|
||||
/// seek the video stream to the same keyframe as the audio stream. The
|
||||
/// resulting timestamps in the output streams may be inaccurate.
|
||||
/// </summary>
|
||||
DisableAccurateSeek = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Prevent audio streams from being copied if the video stream is transcoded.
|
||||
/// The resulting timestamps will be accurate, but additional audio transcoding
|
||||
/// overhead will be incurred.
|
||||
/// </summary>
|
||||
TranscodeAudio = 1,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using MediaBrowser.Model.Entities;
|
||||
|
||||
namespace MediaBrowser.Model.Configuration
|
||||
{
|
||||
public class ImageOption
|
||||
{
|
||||
public ImageOption()
|
||||
{
|
||||
Limit = 1;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the type.
|
||||
/// </summary>
|
||||
/// <value>The type.</value>
|
||||
public ImageType Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the limit.
|
||||
/// </summary>
|
||||
/// <value>The limit.</value>
|
||||
public int Limit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the minimum width.
|
||||
/// </summary>
|
||||
/// <value>The minimum width.</value>
|
||||
public int MinWidth { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
namespace MediaBrowser.Model.Configuration
|
||||
{
|
||||
public enum ImageSavingConvention
|
||||
{
|
||||
Legacy,
|
||||
Compatible
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
|
||||
namespace MediaBrowser.Model.Configuration
|
||||
{
|
||||
public class LibraryOptions
|
||||
{
|
||||
private static readonly string[] _defaultTagDelimiters = ["/", "|", ";", "\\"];
|
||||
|
||||
public LibraryOptions()
|
||||
{
|
||||
TypeOptions = Array.Empty<TypeOptions>();
|
||||
DisabledSubtitleFetchers = Array.Empty<string>();
|
||||
DisabledMediaSegmentProviders = Array.Empty<string>();
|
||||
MediaSegmentProviderOrder = Array.Empty<string>();
|
||||
SubtitleFetcherOrder = Array.Empty<string>();
|
||||
DisabledLocalMetadataReaders = Array.Empty<string>();
|
||||
DisabledLyricFetchers = Array.Empty<string>();
|
||||
LyricFetcherOrder = Array.Empty<string>();
|
||||
|
||||
SkipSubtitlesIfAudioTrackMatches = true;
|
||||
RequirePerfectSubtitleMatch = true;
|
||||
AllowEmbeddedSubtitles = EmbeddedSubtitleOptions.AllowAll;
|
||||
|
||||
AutomaticallyAddToCollection = false;
|
||||
EnablePhotos = true;
|
||||
SaveSubtitlesWithMedia = true;
|
||||
SaveLyricsWithMedia = false;
|
||||
SaveTrickplayWithMedia = false;
|
||||
PathInfos = Array.Empty<MediaPathInfo>();
|
||||
EnableAutomaticSeriesGrouping = true;
|
||||
SeasonZeroDisplayName = "Specials";
|
||||
|
||||
PreferNonstandardArtistsTag = false;
|
||||
UseCustomTagDelimiters = false;
|
||||
CustomTagDelimiters = _defaultTagDelimiters;
|
||||
DelimiterWhitelist = Array.Empty<string>();
|
||||
}
|
||||
|
||||
public bool Enabled { get; set; } = true;
|
||||
|
||||
public bool EnablePhotos { get; set; }
|
||||
|
||||
public bool EnableRealtimeMonitor { get; set; }
|
||||
|
||||
public bool EnableLUFSScan { get; set; }
|
||||
|
||||
public bool EnableChapterImageExtraction { get; set; }
|
||||
|
||||
public bool ExtractChapterImagesDuringLibraryScan { get; set; }
|
||||
|
||||
public bool EnableTrickplayImageExtraction { get; set; }
|
||||
|
||||
public bool ExtractTrickplayImagesDuringLibraryScan { get; set; }
|
||||
|
||||
public MediaPathInfo[] PathInfos { get; set; }
|
||||
|
||||
public bool SaveLocalMetadata { get; set; }
|
||||
|
||||
[Obsolete("Disable remote providers in TypeOptions instead")]
|
||||
public bool EnableInternetProviders { get; set; }
|
||||
|
||||
public bool EnableAutomaticSeriesGrouping { get; set; }
|
||||
|
||||
public bool EnableEmbeddedTitles { get; set; }
|
||||
|
||||
public bool EnableEmbeddedExtrasTitles { get; set; }
|
||||
|
||||
public bool EnableEmbeddedEpisodeInfos { get; set; }
|
||||
|
||||
public int AutomaticRefreshIntervalDays { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the preferred metadata language.
|
||||
/// </summary>
|
||||
/// <value>The preferred metadata language.</value>
|
||||
public string? PreferredMetadataLanguage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the metadata country code.
|
||||
/// </summary>
|
||||
/// <value>The metadata country code.</value>
|
||||
public string? MetadataCountryCode { get; set; }
|
||||
|
||||
public string SeasonZeroDisplayName { get; set; }
|
||||
|
||||
public string[]? MetadataSavers { get; set; }
|
||||
|
||||
public string[] DisabledLocalMetadataReaders { get; set; }
|
||||
|
||||
public string[]? LocalMetadataReaderOrder { get; set; }
|
||||
|
||||
public string[] DisabledSubtitleFetchers { get; set; }
|
||||
|
||||
public string[] SubtitleFetcherOrder { get; set; }
|
||||
|
||||
public string[] DisabledMediaSegmentProviders { get; set; }
|
||||
|
||||
public string[] MediaSegmentProviderOrder { get; set; }
|
||||
|
||||
public bool SkipSubtitlesIfEmbeddedSubtitlesPresent { get; set; }
|
||||
|
||||
public bool SkipSubtitlesIfAudioTrackMatches { get; set; }
|
||||
|
||||
public string[]? SubtitleDownloadLanguages { get; set; }
|
||||
|
||||
public bool RequirePerfectSubtitleMatch { get; set; }
|
||||
|
||||
public bool SaveSubtitlesWithMedia { get; set; }
|
||||
|
||||
[DefaultValue(false)]
|
||||
public bool SaveLyricsWithMedia { get; set; }
|
||||
|
||||
[DefaultValue(false)]
|
||||
public bool SaveTrickplayWithMedia { get; set; }
|
||||
|
||||
public string[] DisabledLyricFetchers { get; set; }
|
||||
|
||||
public string[] LyricFetcherOrder { get; set; }
|
||||
|
||||
[DefaultValue(false)]
|
||||
public bool PreferNonstandardArtistsTag { get; set; }
|
||||
|
||||
[DefaultValue(false)]
|
||||
public bool UseCustomTagDelimiters { get; set; }
|
||||
|
||||
public string[] CustomTagDelimiters { get; set; }
|
||||
|
||||
public string[] DelimiterWhitelist { get; set; }
|
||||
|
||||
public bool AutomaticallyAddToCollection { get; set; }
|
||||
|
||||
public EmbeddedSubtitleOptions AllowEmbeddedSubtitles { get; set; }
|
||||
|
||||
public TypeOptions[] TypeOptions { get; set; }
|
||||
|
||||
public TypeOptions? GetTypeOptions(string type)
|
||||
{
|
||||
foreach (var options in TypeOptions)
|
||||
{
|
||||
if (string.Equals(options.Type, type, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return options;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
namespace MediaBrowser.Model.Configuration
|
||||
{
|
||||
public class MediaPathInfo
|
||||
{
|
||||
public MediaPathInfo(string path)
|
||||
{
|
||||
Path = path;
|
||||
}
|
||||
|
||||
// Needed for xml serialization
|
||||
public MediaPathInfo()
|
||||
{
|
||||
Path = string.Empty;
|
||||
}
|
||||
|
||||
public string Path { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
namespace MediaBrowser.Model.Configuration
|
||||
{
|
||||
public class MetadataConfiguration
|
||||
{
|
||||
public MetadataConfiguration()
|
||||
{
|
||||
UseFileCreationTimeForDateAdded = true;
|
||||
}
|
||||
|
||||
public bool UseFileCreationTimeForDateAdded { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591, CA1819
|
||||
|
||||
using System;
|
||||
|
||||
namespace MediaBrowser.Model.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// Class MetadataOptions.
|
||||
/// </summary>
|
||||
public class MetadataOptions
|
||||
{
|
||||
public MetadataOptions()
|
||||
{
|
||||
DisabledMetadataSavers = Array.Empty<string>();
|
||||
LocalMetadataReaderOrder = Array.Empty<string>();
|
||||
DisabledMetadataFetchers = Array.Empty<string>();
|
||||
MetadataFetcherOrder = Array.Empty<string>();
|
||||
DisabledImageFetchers = Array.Empty<string>();
|
||||
ImageFetcherOrder = Array.Empty<string>();
|
||||
}
|
||||
|
||||
public string ItemType { get; set; }
|
||||
|
||||
public string[] DisabledMetadataSavers { get; set; }
|
||||
|
||||
public string[] LocalMetadataReaderOrder { get; set; }
|
||||
|
||||
public string[] DisabledMetadataFetchers { get; set; }
|
||||
|
||||
public string[] MetadataFetcherOrder { get; set; }
|
||||
|
||||
public string[] DisabledImageFetchers { get; set; }
|
||||
|
||||
public string[] ImageFetcherOrder { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
namespace MediaBrowser.Model.Configuration
|
||||
{
|
||||
public class MetadataPlugin
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the name.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the type.
|
||||
/// </summary>
|
||||
/// <value>The type.</value>
|
||||
public MetadataPluginType Type { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
using MediaBrowser.Model.Entities;
|
||||
|
||||
namespace MediaBrowser.Model.Configuration
|
||||
{
|
||||
public class MetadataPluginSummary
|
||||
{
|
||||
public MetadataPluginSummary()
|
||||
{
|
||||
SupportedImageTypes = Array.Empty<ImageType>();
|
||||
Plugins = Array.Empty<MetadataPlugin>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the type of the item.
|
||||
/// </summary>
|
||||
/// <value>The type of the item.</value>
|
||||
public string ItemType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the plugins.
|
||||
/// </summary>
|
||||
/// <value>The plugins.</value>
|
||||
public MetadataPlugin[] Plugins { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the supported image types.
|
||||
/// </summary>
|
||||
/// <value>The supported image types.</value>
|
||||
public ImageType[] SupportedImageTypes { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
namespace MediaBrowser.Model.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum MetadataPluginType.
|
||||
/// </summary>
|
||||
public enum MetadataPluginType
|
||||
{
|
||||
LocalImageProvider,
|
||||
ImageFetcher,
|
||||
ImageSaver,
|
||||
LocalMetadataProvider,
|
||||
MetadataFetcher,
|
||||
MetadataSaver,
|
||||
SubtitleFetcher,
|
||||
LyricFetcher,
|
||||
MediaSegmentProvider
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
namespace MediaBrowser.Model.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the <see cref="PathSubstitution" />.
|
||||
/// </summary>
|
||||
public class PathSubstitution
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the value to substitute.
|
||||
/// </summary>
|
||||
public string From { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value to substitution with.
|
||||
/// </summary>
|
||||
public string To { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,291 @@
|
||||
#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>
|
||||
/// Represents the server configuration.
|
||||
/// </summary>
|
||||
public class ServerConfiguration : BaseApplicationConfiguration
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ServerConfiguration" /> class.
|
||||
/// </summary>
|
||||
public ServerConfiguration()
|
||||
{
|
||||
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",
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to enable prometheus metrics exporting.
|
||||
/// </summary>
|
||||
public bool EnableMetrics { get; set; } = false;
|
||||
|
||||
public bool EnableNormalizedItemByNameIds { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this instance is port authorized.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is port authorized; otherwise, <c>false</c>.</value>
|
||||
public bool IsPortAuthorized { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether quick connect is available for use on this server.
|
||||
/// </summary>
|
||||
public bool QuickConnectAvailable { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether [enable case-sensitive item ids].
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if [enable case-sensitive item ids]; otherwise, <c>false</c>.</value>
|
||||
public bool EnableCaseSensitiveItemIds { get; set; } = true;
|
||||
|
||||
public bool DisableLiveTvChannelUserDataName { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the metadata path.
|
||||
/// </summary>
|
||||
/// <value>The metadata path.</value>
|
||||
public string MetadataPath { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the preferred metadata language.
|
||||
/// </summary>
|
||||
/// <value>The preferred metadata language.</value>
|
||||
public string PreferredMetadataLanguage { get; set; } = "en";
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the metadata country code.
|
||||
/// </summary>
|
||||
/// <value>The metadata country code.</value>
|
||||
public string MetadataCountryCode { get; set; } = "US";
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets characters to be replaced with a ' ' in strings to create a sort name.
|
||||
/// </summary>
|
||||
/// <value>The sort replace characters.</value>
|
||||
public string[] SortReplaceCharacters { get; set; } = new[] { ".", "+", "%" };
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets characters to be removed from strings to create a sort name.
|
||||
/// </summary>
|
||||
/// <value>The sort remove characters.</value>
|
||||
public string[] SortRemoveCharacters { get; set; } = new[] { ",", "&", "-", "{", "}", "'" };
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets words to be removed from strings to create a sort name.
|
||||
/// </summary>
|
||||
/// <value>The sort remove words.</value>
|
||||
public string[] SortRemoveWords { get; set; } = new[] { "the", "a", "an" };
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the minimum percentage of an item that must be played in order for playstate to be updated.
|
||||
/// </summary>
|
||||
/// <value>The min resume PCT.</value>
|
||||
public int MinResumePct { get; set; } = 5;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the maximum percentage of an item that can be played while still saving playstate. If this percentage is crossed playstate will be reset to the beginning and the item will be marked watched.
|
||||
/// </summary>
|
||||
/// <value>The max resume PCT.</value>
|
||||
public int MaxResumePct { get; set; } = 90;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the minimum duration that an item must have in order to be eligible for playstate updates..
|
||||
/// </summary>
|
||||
/// <value>The min resume duration seconds.</value>
|
||||
public int MinResumeDurationSeconds { get; set; } = 300;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the minimum minutes of a book that must be played in order for playstate to be updated.
|
||||
/// </summary>
|
||||
/// <value>The min resume in minutes.</value>
|
||||
public int MinAudiobookResume { get; set; } = 5;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the remaining minutes of a book that can be played while still saving playstate. If this percentage is crossed playstate will be reset to the beginning and the item will be marked watched.
|
||||
/// </summary>
|
||||
/// <value>The remaining time in minutes.</value>
|
||||
public int MaxAudiobookResume { get; set; } = 5;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the threshold in minutes after a inactive session gets closed automatically.
|
||||
/// If set to 0 the check for inactive sessions gets disabled.
|
||||
/// </summary>
|
||||
/// <value>The close inactive session threshold in minutes. 0 to disable.</value>
|
||||
public int InactiveSessionThreshold { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the delay in seconds that we will wait after a file system change to try and discover what has been added/removed
|
||||
/// Some delay is necessary with some items because their creation is not atomic. It involves the creation of several
|
||||
/// different directories and files.
|
||||
/// </summary>
|
||||
/// <value>The file watcher delay.</value>
|
||||
public int LibraryMonitorDelay { get; set; } = 60;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the duration in seconds that we will wait after a library updated event before executing the library changed notification.
|
||||
/// </summary>
|
||||
/// <value>The library update duration.</value>
|
||||
public int LibraryUpdateDuration { get; set; } = 30;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the maximum amount of items to cache.
|
||||
/// </summary>
|
||||
public int CacheSize { get; set; } = Environment.ProcessorCount * 100;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the image saving convention.
|
||||
/// </summary>
|
||||
/// <value>The image saving convention.</value>
|
||||
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>();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether slow server responses should be logged as a warning.
|
||||
/// </summary>
|
||||
public bool EnableSlowResponseWarning { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the threshold for the slow response time warning in ms.
|
||||
/// </summary>
|
||||
public long SlowResponseThresholdMs { get; set; } = 500;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the cors hosts.
|
||||
/// </summary>
|
||||
public string[] CorsHosts { get; set; } = new[] { "*" };
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the number of days we should retain activity logs.
|
||||
/// </summary>
|
||||
public int? ActivityLogRetentionDays { get; set; } = 30;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the how the library scan fans out.
|
||||
/// </summary>
|
||||
public int LibraryScanFanoutConcurrency { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the how many metadata refreshes can run concurrently.
|
||||
/// </summary>
|
||||
public int LibraryMetadataRefreshConcurrency { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether clients should be allowed to upload logs.
|
||||
/// </summary>
|
||||
public bool AllowClientLogUpload { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the dummy chapter duration in seconds, use 0 (zero) or less to disable generation altogether.
|
||||
/// </summary>
|
||||
/// <value>The dummy chapters duration.</value>
|
||||
public int DummyChapterDuration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the chapter image resolution.
|
||||
/// </summary>
|
||||
/// <value>The chapter image resolution.</value>
|
||||
public ImageResolution ChapterImageResolution { get; set; } = ImageResolution.MatchSource;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the limit for parallel image encoding.
|
||||
/// </summary>
|
||||
/// <value>The limit for parallel image encoding.</value>
|
||||
public int ParallelImageEncodingLimit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the list of cast receiver applications.
|
||||
/// </summary>
|
||||
public CastReceiverApplication[] CastReceiverApplications { get; set; } = Array.Empty<CastReceiverApplication>();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the trickplay options.
|
||||
/// </summary>
|
||||
/// <value>The trickplay options.</value>
|
||||
public TrickplayOptions TrickplayOptions { get; set; } = new TrickplayOptions();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether old authorization methods are allowed.
|
||||
/// </summary>
|
||||
public bool EnableLegacyAuthorization { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace MediaBrowser.Model.Configuration;
|
||||
|
||||
/// <summary>
|
||||
/// Class TrickplayOptions.
|
||||
/// </summary>
|
||||
public class TrickplayOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether or not to use HW acceleration.
|
||||
/// </summary>
|
||||
public bool EnableHwAcceleration { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether or not to use HW accelerated MJPEG encoding.
|
||||
/// </summary>
|
||||
public bool EnableHwEncoding { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to only extract key frames.
|
||||
/// Significantly faster, but is not compatible with all decoders and/or video files.
|
||||
/// </summary>
|
||||
public bool EnableKeyFrameOnlyExtraction { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the behavior used by trickplay provider on library scan/update.
|
||||
/// </summary>
|
||||
public TrickplayScanBehavior ScanBehavior { get; set; } = TrickplayScanBehavior.NonBlocking;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the process priority for the ffmpeg process.
|
||||
/// </summary>
|
||||
public ProcessPriorityClass ProcessPriority { get; set; } = ProcessPriorityClass.BelowNormal;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the interval, in ms, between each new trickplay image.
|
||||
/// </summary>
|
||||
public int Interval { get; set; } = 10000;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the target width resolutions, in px, to generates preview images for.
|
||||
/// </summary>
|
||||
public int[] WidthResolutions { get; set; } = new[] { 320 };
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets number of tile images to allow in X dimension.
|
||||
/// </summary>
|
||||
public int TileWidth { get; set; } = 10;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets number of tile images to allow in Y dimension.
|
||||
/// </summary>
|
||||
public int TileHeight { get; set; } = 10;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ffmpeg output quality level.
|
||||
/// </summary>
|
||||
public int Qscale { get; set; } = 4;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the jpeg quality to use for image tiles.
|
||||
/// </summary>
|
||||
public int JpegQuality { get; set; } = 90;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the number of threads to be used by ffmpeg.
|
||||
/// </summary>
|
||||
public int ProcessThreads { get; set; } = 1;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace MediaBrowser.Model.Configuration;
|
||||
|
||||
/// <summary>
|
||||
/// Enum TrickplayScanBehavior.
|
||||
/// </summary>
|
||||
public enum TrickplayScanBehavior
|
||||
{
|
||||
/// <summary>
|
||||
/// Starts generation, only return once complete.
|
||||
/// </summary>
|
||||
Blocking,
|
||||
|
||||
/// <summary>
|
||||
/// Start generation, return immediately.
|
||||
/// </summary>
|
||||
NonBlocking
|
||||
}
|
||||
@@ -0,0 +1,365 @@
|
||||
#nullable disable
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Model.Entities;
|
||||
|
||||
namespace MediaBrowser.Model.Configuration
|
||||
{
|
||||
public class TypeOptions
|
||||
{
|
||||
public static readonly ImageOption DefaultInstance = new ImageOption();
|
||||
|
||||
public static readonly Dictionary<string, ImageOption[]> DefaultImageOptions = new Dictionary<string, ImageOption[]>
|
||||
{
|
||||
{
|
||||
"Movie", new[]
|
||||
{
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 1,
|
||||
MinWidth = 1280,
|
||||
Type = ImageType.Backdrop
|
||||
},
|
||||
|
||||
// Don't download this by default as it's rarely used.
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 0,
|
||||
Type = ImageType.Art
|
||||
},
|
||||
|
||||
// Don't download this by default as it's rarely used.
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 0,
|
||||
Type = ImageType.Disc
|
||||
},
|
||||
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 1,
|
||||
Type = ImageType.Primary
|
||||
},
|
||||
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 0,
|
||||
Type = ImageType.Banner
|
||||
},
|
||||
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 1,
|
||||
Type = ImageType.Thumb
|
||||
},
|
||||
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 1,
|
||||
Type = ImageType.Logo
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"MusicVideo", new[]
|
||||
{
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 1,
|
||||
MinWidth = 1280,
|
||||
Type = ImageType.Backdrop
|
||||
},
|
||||
|
||||
// Don't download this by default as it's rarely used.
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 0,
|
||||
Type = ImageType.Art
|
||||
},
|
||||
|
||||
// Don't download this by default as it's rarely used.
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 0,
|
||||
Type = ImageType.Disc
|
||||
},
|
||||
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 1,
|
||||
Type = ImageType.Primary
|
||||
},
|
||||
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 0,
|
||||
Type = ImageType.Banner
|
||||
},
|
||||
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 1,
|
||||
Type = ImageType.Thumb
|
||||
},
|
||||
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 1,
|
||||
Type = ImageType.Logo
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Series", new[]
|
||||
{
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 1,
|
||||
MinWidth = 1280,
|
||||
Type = ImageType.Backdrop
|
||||
},
|
||||
|
||||
// Don't download this by default as it's rarely used.
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 0,
|
||||
Type = ImageType.Art
|
||||
},
|
||||
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 1,
|
||||
Type = ImageType.Primary
|
||||
},
|
||||
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 1,
|
||||
Type = ImageType.Banner
|
||||
},
|
||||
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 1,
|
||||
Type = ImageType.Thumb
|
||||
},
|
||||
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 1,
|
||||
Type = ImageType.Logo
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"MusicAlbum", new[]
|
||||
{
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 0,
|
||||
MinWidth = 1280,
|
||||
Type = ImageType.Backdrop
|
||||
},
|
||||
|
||||
// Don't download this by default as it's rarely used.
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 0,
|
||||
Type = ImageType.Disc
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"MusicArtist", new[]
|
||||
{
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 1,
|
||||
MinWidth = 1280,
|
||||
Type = ImageType.Backdrop
|
||||
},
|
||||
|
||||
// Don't download this by default
|
||||
// They do look great, but most artists won't have them, which means a banner view isn't really possible
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 0,
|
||||
Type = ImageType.Banner
|
||||
},
|
||||
|
||||
// Don't download this by default
|
||||
// Generally not used
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 0,
|
||||
Type = ImageType.Art
|
||||
},
|
||||
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 1,
|
||||
Type = ImageType.Logo
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"BoxSet", new[]
|
||||
{
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 1,
|
||||
MinWidth = 1280,
|
||||
Type = ImageType.Backdrop
|
||||
},
|
||||
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 1,
|
||||
Type = ImageType.Primary
|
||||
},
|
||||
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 1,
|
||||
Type = ImageType.Thumb
|
||||
},
|
||||
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 1,
|
||||
Type = ImageType.Logo
|
||||
},
|
||||
|
||||
// Don't download this by default as it's rarely used.
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 0,
|
||||
Type = ImageType.Art
|
||||
},
|
||||
|
||||
// Don't download this by default as it's rarely used.
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 0,
|
||||
Type = ImageType.Disc
|
||||
},
|
||||
|
||||
// Don't download this by default as it's rarely used.
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 0,
|
||||
Type = ImageType.Banner
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Season", new[]
|
||||
{
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 0,
|
||||
MinWidth = 1280,
|
||||
Type = ImageType.Backdrop
|
||||
},
|
||||
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 1,
|
||||
Type = ImageType.Primary
|
||||
},
|
||||
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 0,
|
||||
Type = ImageType.Banner
|
||||
},
|
||||
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 0,
|
||||
Type = ImageType.Thumb
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Episode", new[]
|
||||
{
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 0,
|
||||
MinWidth = 1280,
|
||||
Type = ImageType.Backdrop
|
||||
},
|
||||
|
||||
new ImageOption
|
||||
{
|
||||
Limit = 1,
|
||||
Type = ImageType.Primary
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public TypeOptions()
|
||||
{
|
||||
MetadataFetchers = Array.Empty<string>();
|
||||
MetadataFetcherOrder = Array.Empty<string>();
|
||||
ImageFetchers = Array.Empty<string>();
|
||||
ImageFetcherOrder = Array.Empty<string>();
|
||||
ImageOptions = Array.Empty<ImageOption>();
|
||||
}
|
||||
|
||||
public string Type { get; set; }
|
||||
|
||||
public string[] MetadataFetchers { get; set; }
|
||||
|
||||
public string[] MetadataFetcherOrder { get; set; }
|
||||
|
||||
public string[] ImageFetchers { get; set; }
|
||||
|
||||
public string[] ImageFetcherOrder { get; set; }
|
||||
|
||||
public ImageOption[] ImageOptions { get; set; }
|
||||
|
||||
public ImageOption GetImageOptions(ImageType type)
|
||||
{
|
||||
foreach (var i in ImageOptions)
|
||||
{
|
||||
if (i.Type == type)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
if (DefaultImageOptions.TryGetValue(Type, out ImageOption[] options))
|
||||
{
|
||||
foreach (var i in options)
|
||||
{
|
||||
if (i.Type == type)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return DefaultInstance;
|
||||
}
|
||||
|
||||
public int GetLimit(ImageType type)
|
||||
{
|
||||
return GetImageOptions(type).Limit;
|
||||
}
|
||||
|
||||
public int GetMinWidth(ImageType type)
|
||||
{
|
||||
return GetImageOptions(type).MinWidth;
|
||||
}
|
||||
|
||||
public bool IsEnabled(ImageType type)
|
||||
{
|
||||
return GetLimit(type) > 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
using Jellyfin.Database.Implementations.Enums;
|
||||
|
||||
namespace MediaBrowser.Model.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// Class UserConfiguration.
|
||||
/// </summary>
|
||||
public class UserConfiguration
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UserConfiguration" /> class.
|
||||
/// </summary>
|
||||
public UserConfiguration()
|
||||
{
|
||||
EnableNextEpisodeAutoPlay = true;
|
||||
RememberAudioSelections = true;
|
||||
RememberSubtitleSelections = true;
|
||||
|
||||
HidePlayedInLatest = true;
|
||||
PlayDefaultAudioTrack = true;
|
||||
|
||||
LatestItemsExcludes = Array.Empty<Guid>();
|
||||
OrderedViews = Array.Empty<Guid>();
|
||||
MyMediaExcludes = Array.Empty<Guid>();
|
||||
GroupedFolders = Array.Empty<Guid>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the audio language preference.
|
||||
/// </summary>
|
||||
/// <value>The audio language preference.</value>
|
||||
public string? AudioLanguagePreference { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether [play default audio track].
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if [play default audio track]; otherwise, <c>false</c>.</value>
|
||||
public bool PlayDefaultAudioTrack { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the subtitle language preference.
|
||||
/// </summary>
|
||||
/// <value>The subtitle language preference.</value>
|
||||
public string? SubtitleLanguagePreference { get; set; }
|
||||
|
||||
public bool DisplayMissingEpisodes { get; set; }
|
||||
|
||||
public Guid[] GroupedFolders { get; set; }
|
||||
|
||||
public SubtitlePlaybackMode SubtitleMode { get; set; }
|
||||
|
||||
public bool DisplayCollectionsView { get; set; }
|
||||
|
||||
public bool EnableLocalPassword { get; set; }
|
||||
|
||||
public Guid[] OrderedViews { get; set; }
|
||||
|
||||
public Guid[] LatestItemsExcludes { get; set; }
|
||||
|
||||
public Guid[] MyMediaExcludes { get; set; }
|
||||
|
||||
public bool HidePlayedInLatest { get; set; }
|
||||
|
||||
public bool RememberAudioSelections { get; set; }
|
||||
|
||||
public bool RememberSubtitleSelections { get; set; }
|
||||
|
||||
public bool EnableNextEpisodeAutoPlay { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the id of the selected cast receiver.
|
||||
/// </summary>
|
||||
public string? CastReceiverId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
namespace MediaBrowser.Model.Configuration
|
||||
{
|
||||
public class XbmcMetadataOptions
|
||||
{
|
||||
public XbmcMetadataOptions()
|
||||
{
|
||||
ReleaseDateFormat = "yyyy-MM-dd";
|
||||
|
||||
SaveImagePathsInNfo = true;
|
||||
EnablePathSubstitution = true;
|
||||
}
|
||||
|
||||
public string? UserId { get; set; }
|
||||
|
||||
public string ReleaseDateFormat { get; set; }
|
||||
|
||||
public bool SaveImagePathsInNfo { get; set; }
|
||||
|
||||
public bool EnablePathSubstitution { get; set; }
|
||||
|
||||
public bool EnableExtraThumbsDuplication { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user