diff options
Diffstat (limited to 'MediaBrowser.Model/Configuration')
18 files changed, 1170 insertions, 0 deletions
diff --git a/MediaBrowser.Model/Configuration/AccessSchedule.cs b/MediaBrowser.Model/Configuration/AccessSchedule.cs new file mode 100644 index 000000000..3a66cf5bb --- /dev/null +++ b/MediaBrowser.Model/Configuration/AccessSchedule.cs @@ -0,0 +1,22 @@ + +namespace MediaBrowser.Model.Configuration +{ + public class AccessSchedule + { + /// <summary> + /// Gets or sets the day of week. + /// </summary> + /// <value>The day of week.</value> + public DynamicDayOfWeek DayOfWeek { get; set; } + /// <summary> + /// Gets or sets the start hour. + /// </summary> + /// <value>The start hour.</value> + public double StartHour { get; set; } + /// <summary> + /// Gets or sets the end hour. + /// </summary> + /// <value>The end hour.</value> + public double EndHour { get; set; } + } +} diff --git a/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs b/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs new file mode 100644 index 000000000..b5b0101cb --- /dev/null +++ b/MediaBrowser.Model/Configuration/BaseApplicationConfiguration.cs @@ -0,0 +1,57 @@ +using MediaBrowser.Model.Updates; + +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> + /// Gets or sets a value indicating whether [enable debug level logging]. + /// </summary> + /// <value><c>true</c> if [enable debug level logging]; otherwise, <c>false</c>.</value> + public bool EnableDebugLevelLogging { get; set; } + + /// <summary> + /// Enable automatically and silently updating of the application + /// </summary> + /// <value><c>true</c> if [enable auto update]; otherwise, <c>false</c>.</value> + public bool EnableAutoUpdate { get; set; } + + /// <summary> + /// 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 [run at startup]. + /// </summary> + /// <value><c>true</c> if [run at startup]; otherwise, <c>false</c>.</value> + public bool RunAtStartup { 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> + /// Initializes a new instance of the <see cref="BaseApplicationConfiguration" /> class. + /// </summary> + public BaseApplicationConfiguration() + { + EnableAutoUpdate = true; + LogFileRetentionDays = 3; + } + } +} diff --git a/MediaBrowser.Model/Configuration/DynamicDayOfWeek.cs b/MediaBrowser.Model/Configuration/DynamicDayOfWeek.cs new file mode 100644 index 000000000..1c7de11fd --- /dev/null +++ b/MediaBrowser.Model/Configuration/DynamicDayOfWeek.cs @@ -0,0 +1,17 @@ + +namespace MediaBrowser.Model.Configuration +{ + public enum DynamicDayOfWeek + { + Sunday = 0, + Monday = 1, + Tuesday = 2, + Wednesday = 3, + Thursday = 4, + Friday = 5, + Saturday = 6, + Everyday = 7, + Weekday = 8, + Weekend = 9 + } +} diff --git a/MediaBrowser.Model/Configuration/EncodingOptions.cs b/MediaBrowser.Model/Configuration/EncodingOptions.cs new file mode 100644 index 000000000..fbc5e1b37 --- /dev/null +++ b/MediaBrowser.Model/Configuration/EncodingOptions.cs @@ -0,0 +1,36 @@ + +namespace MediaBrowser.Model.Configuration +{ + public class EncodingOptions + { + public int EncodingThreadCount { get; set; } + public string TranscodingTempPath { get; set; } + public double DownMixAudioBoost { get; set; } + public bool EnableThrottling { get; set; } + public int ThrottleDelaySeconds { get; set; } + public string HardwareAccelerationType { get; set; } + public string EncoderAppPath { get; set; } + public string VaapiDevice { get; set; } + public int H264Crf { get; set; } + public string H264Preset { get; set; } + public string DeinterlaceMethod { get; set; } + public bool EnableHardwareEncoding { get; set; } + public bool EnableSubtitleExtraction { get; set; } + + public string[] HardwareDecodingCodecs { get; set; } + + public EncodingOptions() + { + DownMixAudioBoost = 2; + EnableThrottling = true; + ThrottleDelaySeconds = 180; + 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"; + H264Crf = 23; + EnableHardwareEncoding = true; + EnableSubtitleExtraction = true; + HardwareDecodingCodecs = new string[] { "h264", "vc1" }; + } + } +} diff --git a/MediaBrowser.Model/Configuration/FanartOptions.cs b/MediaBrowser.Model/Configuration/FanartOptions.cs new file mode 100644 index 000000000..6924b25d7 --- /dev/null +++ b/MediaBrowser.Model/Configuration/FanartOptions.cs @@ -0,0 +1,12 @@ + +namespace MediaBrowser.Model.Configuration +{ + public class FanartOptions + { + /// <summary> + /// Gets or sets the user API key. + /// </summary> + /// <value>The user API key.</value> + public string UserApiKey { get; set; } + } +} diff --git a/MediaBrowser.Model/Configuration/ImageOption.cs b/MediaBrowser.Model/Configuration/ImageOption.cs new file mode 100644 index 000000000..ade0af83e --- /dev/null +++ b/MediaBrowser.Model/Configuration/ImageOption.cs @@ -0,0 +1,29 @@ +using MediaBrowser.Model.Entities; + +namespace MediaBrowser.Model.Configuration +{ + public class ImageOption + { + /// <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; } + + public ImageOption() + { + Limit = 1; + } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Configuration/ImageSavingConvention.cs b/MediaBrowser.Model/Configuration/ImageSavingConvention.cs new file mode 100644 index 000000000..611678e67 --- /dev/null +++ b/MediaBrowser.Model/Configuration/ImageSavingConvention.cs @@ -0,0 +1,8 @@ +namespace MediaBrowser.Model.Configuration +{ + public enum ImageSavingConvention + { + Legacy, + Compatible + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Configuration/LibraryOptions.cs b/MediaBrowser.Model/Configuration/LibraryOptions.cs new file mode 100644 index 000000000..a271d43af --- /dev/null +++ b/MediaBrowser.Model/Configuration/LibraryOptions.cs @@ -0,0 +1,444 @@ +using System; +using MediaBrowser.Model.Entities; +using System.Collections.Generic; + +namespace MediaBrowser.Model.Configuration +{ + public class LibraryOptions + { + public bool EnableArchiveMediaFiles { get; set; } + public bool EnablePhotos { get; set; } + public bool EnableRealtimeMonitor { get; set; } + public bool EnableChapterImageExtraction { get; set; } + public bool ExtractChapterImagesDuringLibraryScan { get; set; } + public bool DownloadImagesInAdvance { get; set; } + public MediaPathInfo[] PathInfos { get; set; } + + public bool SaveLocalMetadata { get; set; } + public bool EnableInternetProviders { get; set; } + public bool ImportMissingEpisodes { get; set; } + public bool EnableAutomaticSeriesGrouping { get; set; } + public bool EnableEmbeddedTitles { 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 bool SkipSubtitlesIfEmbeddedSubtitlesPresent { get; set; } + public bool SkipSubtitlesIfAudioTrackMatches { get; set; } + public string[] SubtitleDownloadLanguages { get; set; } + public bool RequirePerfectSubtitleMatch { get; set; } + public bool SaveSubtitlesWithMedia { 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; + } + + public LibraryOptions() + { + TypeOptions = new TypeOptions[] { }; + DisabledSubtitleFetchers = new string[] { }; + SubtitleFetcherOrder = new string[] { }; + DisabledLocalMetadataReaders = new string[] { }; + + SkipSubtitlesIfAudioTrackMatches = true; + RequirePerfectSubtitleMatch = true; + + EnablePhotos = true; + SaveSubtitlesWithMedia = true; + EnableRealtimeMonitor = true; + PathInfos = new MediaPathInfo[] { }; + EnableInternetProviders = true; + EnableAutomaticSeriesGrouping = true; + SeasonZeroDisplayName = "Specials"; + } + } + + public class MediaPathInfo + { + public string Path { get; set; } + public string NetworkPath { get; set; } + } + + public class TypeOptions + { + 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 (ImageOption i in ImageOptions) + { + if (i.Type == type) + { + return i; + } + } + + ImageOption[] options; + if (DefaultImageOptions.TryGetValue(Type, out options)) + { + foreach (ImageOption 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; + } + + public TypeOptions() + { + MetadataFetchers = new string[] { }; + MetadataFetcherOrder = new string[] { }; + ImageFetchers = new string[] { }; + ImageFetcherOrder = new string[] { }; + ImageOptions = new ImageOption[] { }; + } + + public static 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 static ImageOption DefaultInstance = new ImageOption(); + } +} diff --git a/MediaBrowser.Model/Configuration/MetadataConfiguration.cs b/MediaBrowser.Model/Configuration/MetadataConfiguration.cs new file mode 100644 index 000000000..d1658e5d6 --- /dev/null +++ b/MediaBrowser.Model/Configuration/MetadataConfiguration.cs @@ -0,0 +1,13 @@ + +namespace MediaBrowser.Model.Configuration +{ + public class MetadataConfiguration + { + public bool UseFileCreationTimeForDateAdded { get; set; } + + public MetadataConfiguration() + { + UseFileCreationTimeForDateAdded = true; + } + } +} diff --git a/MediaBrowser.Model/Configuration/MetadataOptions.cs b/MediaBrowser.Model/Configuration/MetadataOptions.cs new file mode 100644 index 000000000..26cfee085 --- /dev/null +++ b/MediaBrowser.Model/Configuration/MetadataOptions.cs @@ -0,0 +1,38 @@ +using MediaBrowser.Model.Extensions; +using System; + +namespace MediaBrowser.Model.Configuration +{ + /// <summary> + /// Class MetadataOptions. + /// </summary> + public class MetadataOptions + { + 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; } + + public MetadataOptions() + { + DisabledMetadataSavers = new string[] { }; + LocalMetadataReaderOrder = new string[] { }; + + DisabledMetadataFetchers = new string[] { }; + MetadataFetcherOrder = new string[] { }; + DisabledImageFetchers = new string[] { }; + ImageFetcherOrder = new string[] { }; + } + + public bool IsMetadataSaverEnabled(string name) + { + return !ListHelper.ContainsIgnoreCase(DisabledMetadataSavers, name); + } + } +} diff --git a/MediaBrowser.Model/Configuration/MetadataPlugin.cs b/MediaBrowser.Model/Configuration/MetadataPlugin.cs new file mode 100644 index 000000000..f3e0ce106 --- /dev/null +++ b/MediaBrowser.Model/Configuration/MetadataPlugin.cs @@ -0,0 +1,17 @@ +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; } + } +} diff --git a/MediaBrowser.Model/Configuration/MetadataPluginSummary.cs b/MediaBrowser.Model/Configuration/MetadataPluginSummary.cs new file mode 100644 index 000000000..80142cf43 --- /dev/null +++ b/MediaBrowser.Model/Configuration/MetadataPluginSummary.cs @@ -0,0 +1,32 @@ +using System.Collections.Generic; +using MediaBrowser.Model.Entities; + +namespace MediaBrowser.Model.Configuration +{ + public class MetadataPluginSummary + { + /// <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; } + + public MetadataPluginSummary() + { + SupportedImageTypes = new ImageType[] { }; + Plugins = new MetadataPlugin[] { }; + } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Configuration/MetadataPluginType.cs b/MediaBrowser.Model/Configuration/MetadataPluginType.cs new file mode 100644 index 000000000..5ba0b395e --- /dev/null +++ b/MediaBrowser.Model/Configuration/MetadataPluginType.cs @@ -0,0 +1,16 @@ +namespace MediaBrowser.Model.Configuration +{ + /// <summary> + /// Enum MetadataPluginType + /// </summary> + public enum MetadataPluginType + { + LocalImageProvider, + ImageFetcher, + ImageSaver, + LocalMetadataProvider, + MetadataFetcher, + MetadataSaver, + SubtitleFetcher + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs new file mode 100644 index 000000000..58a839167 --- /dev/null +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -0,0 +1,313 @@ +using MediaBrowser.Model.Dto; +using MediaBrowser.Model.Entities; +using System; + +namespace MediaBrowser.Model.Configuration +{ + /// <summary> + /// Represents the server configuration. + /// </summary> + public class ServerConfiguration : BaseApplicationConfiguration + { + public const int DefaultHttpPort = 8096; + public const int DefaultHttpsPort = 8920; + + /// <summary> + /// Gets or sets a value indicating whether [enable u pn p]. + /// </summary> + /// <value><c>true</c> if [enable u pn p]; otherwise, <c>false</c>.</value> + public bool EnableUPnP { get; set; } + + /// <summary> + /// Gets or sets the public mapped port. + /// </summary> + /// <value>The public mapped port.</value> + public int PublicPort { get; set; } + + /// <summary> + /// Gets or sets the public HTTPS port. + /// </summary> + /// <value>The public HTTPS port.</value> + public int PublicHttpsPort { get; set; } + + /// <summary> + /// Gets or sets the HTTP server port number. + /// </summary> + /// <value>The HTTP server port number.</value> + public int HttpServerPortNumber { get; set; } + + /// <summary> + /// Gets or sets the HTTPS server port number. + /// </summary> + /// <value>The HTTPS server port number.</value> + public int HttpsPortNumber { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether [use HTTPS]. + /// </summary> + /// <value><c>true</c> if [use HTTPS]; otherwise, <c>false</c>.</value> + public bool EnableHttps { get; set; } + public bool EnableNormalizedItemByNameIds { get; set; } + + /// <summary> + /// Gets or sets the value pointing to the file system where the ssl certiifcate is located.. + /// </summary> + /// <value>The value pointing to the file system where the ssl certiifcate is located..</value> + public string CertificatePath { get; set; } + public string CertificatePassword { get; set; } + + /// <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; } + + public bool AutoRunWebApp { get; set; } + public bool EnableRemoteAccess { get; set; } + public bool CameraUploadUpgraded { get; set; } + public bool CollectionsUpgraded { get; set; } + + /// <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; } + + public bool DisableLiveTvChannelUserDataName { get; set; } + + /// <summary> + /// Gets or sets the metadata path. + /// </summary> + /// <value>The metadata path.</value> + public string MetadataPath { get; set; } + public string MetadataNetworkPath { 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; } + + /// <summary> + /// 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; } + + /// <summary> + /// Characters to be removed from strings to create a sort name + /// </summary> + /// <value>The sort remove characters.</value> + public string[] SortRemoveCharacters { get; set; } + + /// <summary> + /// Words to be removed from strings to create a sort name + /// </summary> + /// <value>The sort remove words.</value> + public string[] SortRemoveWords { get; set; } + + /// <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; } + + /// <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; } + + /// <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; } + + /// <summary> + /// 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; } + + /// <summary> + /// Gets or sets a value indicating whether [enable dashboard response caching]. + /// Allows potential contributors without visual studio to modify production dashboard code and test changes. + /// </summary> + /// <value><c>true</c> if [enable dashboard response caching]; otherwise, <c>false</c>.</value> + public bool EnableDashboardResponseCaching { get; set; } + + /// <summary> + /// Allows the dashboard to be served from a custom path. + /// </summary> + /// <value>The dashboard source path.</value> + public string DashboardSourcePath { get; set; } + + /// <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 EnableAutomaticRestart { get; set; } + public bool SkipDeserializationForBasicTypes { get; set; } + + public string ServerName { get; set; } + public string WanDdns { get; set; } + + public string UICulture { get; set; } + + public bool SaveMetadataHidden { get; set; } + + public NameValuePair[] ContentTypes { get; set; } + + public int RemoteClientBitrateLimit { get; set; } + + public int SchemaVersion { get; set; } + + public bool EnableAnonymousUsageReporting { get; set; } + public bool EnableFolderView { get; set; } + public bool EnableGroupingIntoCollections { get; set; } + public bool DisplaySpecialsWithinSeasons { get; set; } + public string[] LocalNetworkSubnets { get; set; } + public string[] LocalNetworkAddresses { get; set; } + public string[] CodecsUsed { get; set; } + public bool EnableExternalContentInSuggestions { get; set; } + public bool RequireHttps { get; set; } + public bool IsBehindProxy { get; set; } + public bool EnableNewOmdbSupport { get; set; } + + public string[] RemoteIPFilter { get; set; } + public bool IsRemoteIPFilterBlacklist { get; set; } + + public int ImageExtractionTimeoutMs { get; set; } + + public PathSubstitution[] PathSubstitutions { get; set; } + public bool EnableSimpleArtistDetection { get; set; } + + public string[] UninstalledPlugins { get; set; } + + /// <summary> + /// Initializes a new instance of the <see cref="ServerConfiguration" /> class. + /// </summary> + public ServerConfiguration() + { + UninstalledPlugins = new string[] { }; + RemoteIPFilter = new string[] { }; + LocalNetworkSubnets = new string[] { }; + LocalNetworkAddresses = new string[] { }; + CodecsUsed = new string[] { }; + ImageExtractionTimeoutMs = 0; + PathSubstitutions = new PathSubstitution[] { }; + EnableSimpleArtistDetection = true; + + DisplaySpecialsWithinSeasons = true; + EnableExternalContentInSuggestions = true; + + ImageSavingConvention = ImageSavingConvention.Compatible; + PublicPort = DefaultHttpPort; + PublicHttpsPort = DefaultHttpsPort; + HttpServerPortNumber = DefaultHttpPort; + HttpsPortNumber = DefaultHttpsPort; + EnableHttps = true; + EnableDashboardResponseCaching = true; + EnableAnonymousUsageReporting = true; + EnableCaseSensitiveItemIds = true; + + EnableAutomaticRestart = true; + AutoRunWebApp = true; + EnableRemoteAccess = true; + + EnableUPnP = true; + MinResumePct = 5; + MaxResumePct = 90; + + // 5 minutes + MinResumeDurationSeconds = 300; + + LibraryMonitorDelay = 60; + + ContentTypes = new NameValuePair[] { }; + + PreferredMetadataLanguage = "en"; + MetadataCountryCode = "US"; + + SortReplaceCharacters = new[] { ".", "+", "%" }; + SortRemoveCharacters = new[] { ",", "&", "-", "{", "}", "'" }; + SortRemoveWords = new[] { "the", "a", "an" }; + + UICulture = "en-us"; + + 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", "FanArt" } + }, + + new MetadataOptions + { + ItemType = "Series", + DisabledMetadataFetchers = new []{ "TheMovieDb" }, + DisabledImageFetchers = new []{ "TheMovieDb" } + }, + + new MetadataOptions + { + ItemType = "MusicAlbum", + DisabledMetadataFetchers = new []{ "TheAudioDB" } + }, + + new MetadataOptions + { + ItemType = "MusicArtist", + DisabledMetadataFetchers = new []{ "TheAudioDB" } + }, + + new MetadataOptions + { + ItemType = "BoxSet" + }, + + new MetadataOptions + { + ItemType = "Season", + DisabledMetadataFetchers = new []{ "TheMovieDb" }, + DisabledImageFetchers = new [] { "FanArt" } + }, + + new MetadataOptions + { + ItemType = "Episode", + DisabledMetadataFetchers = new []{ "The Open Movie Database", "TheMovieDb" }, + DisabledImageFetchers = new []{ "The Open Movie Database", "TheMovieDb" } + } + }; + } + } + + public class PathSubstitution + { + public string From { get; set; } + public string To { get; set; } + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Configuration/SubtitlePlaybackMode.cs b/MediaBrowser.Model/Configuration/SubtitlePlaybackMode.cs new file mode 100644 index 000000000..fbee912d9 --- /dev/null +++ b/MediaBrowser.Model/Configuration/SubtitlePlaybackMode.cs @@ -0,0 +1,11 @@ +namespace MediaBrowser.Model.Configuration +{ + public enum SubtitlePlaybackMode + { + Default = 0, + Always = 1, + OnlyForced = 2, + None = 3, + Smart = 4 + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Configuration/UnratedItem.cs b/MediaBrowser.Model/Configuration/UnratedItem.cs new file mode 100644 index 000000000..1082d684b --- /dev/null +++ b/MediaBrowser.Model/Configuration/UnratedItem.cs @@ -0,0 +1,16 @@ +namespace MediaBrowser.Model.Configuration +{ + public enum UnratedItem + { + Movie, + Trailer, + Series, + Music, + Game, + Book, + LiveTvChannel, + LiveTvProgram, + ChannelContent, + Other + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/Configuration/UserConfiguration.cs b/MediaBrowser.Model/Configuration/UserConfiguration.cs new file mode 100644 index 000000000..34b0be095 --- /dev/null +++ b/MediaBrowser.Model/Configuration/UserConfiguration.cs @@ -0,0 +1,66 @@ +using System; + +namespace MediaBrowser.Model.Configuration +{ + /// <summary> + /// Class UserConfiguration + /// </summary> + public class UserConfiguration + { + /// <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 string[] GroupedFolders { get; set; } + + public SubtitlePlaybackMode SubtitleMode { get; set; } + public bool DisplayCollectionsView { get; set; } + + public bool EnableLocalPassword { get; set; } + + public string[] OrderedViews { get; set; } + + public string[] LatestItemsExcludes { get; set; } + public string[] MyMediaExcludes { get; set; } + + public bool HidePlayedInLatest { get; set; } + + public bool RememberAudioSelections { get; set; } + public bool RememberSubtitleSelections { get; set; } + public bool EnableNextEpisodeAutoPlay { get; set; } + + /// <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 = new string[] {}; + OrderedViews = new string[] {}; + MyMediaExcludes = new string[] {}; + GroupedFolders = new string[] {}; + } + } +} diff --git a/MediaBrowser.Model/Configuration/XbmcMetadataOptions.cs b/MediaBrowser.Model/Configuration/XbmcMetadataOptions.cs new file mode 100644 index 000000000..de8a59a3d --- /dev/null +++ b/MediaBrowser.Model/Configuration/XbmcMetadataOptions.cs @@ -0,0 +1,23 @@ + +namespace MediaBrowser.Model.Configuration +{ + public class XbmcMetadataOptions + { + 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; } + + public XbmcMetadataOptions() + { + ReleaseDateFormat = "yyyy-MM-dd"; + + SaveImagePathsInNfo = true; + EnablePathSubstitution = true; + } + } +} |
