< Summary - Jellyfin

Information
Class: MediaBrowser.Model.Configuration.LibraryOptions
Assembly: MediaBrowser.Model
File(s): /srv/git/jellyfin/MediaBrowser.Model/Configuration/LibraryOptions.cs
Line coverage
100%
Covered lines: 29
Uncovered lines: 0
Coverable lines: 29
Total lines: 153
Line coverage: 100%
Branch coverage
75%
Covered branches: 3
Total branches: 4
Branch coverage: 75%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.cctor()100%11100%
.ctor()100%11100%
GetTypeOptions(...)75%44100%

File(s)

/srv/git/jellyfin/MediaBrowser.Model/Configuration/LibraryOptions.cs

#LineLine coverage
 1#pragma warning disable CS1591
 2
 3using System;
 4using System.ComponentModel;
 5
 6namespace MediaBrowser.Model.Configuration
 7{
 8    public class LibraryOptions
 9    {
 210        private static readonly char[] _defaultTagDelimiters = ['/', '|', ';', '\\'];
 11
 12        public LibraryOptions()
 13        {
 53314            TypeOptions = Array.Empty<TypeOptions>();
 53315            DisabledSubtitleFetchers = Array.Empty<string>();
 53316            DisabledMediaSegmentProviders = Array.Empty<string>();
 53317            MediaSegmentProvideOrder = Array.Empty<string>();
 53318            SubtitleFetcherOrder = Array.Empty<string>();
 53319            DisabledLocalMetadataReaders = Array.Empty<string>();
 53320            DisabledLyricFetchers = Array.Empty<string>();
 53321            LyricFetcherOrder = Array.Empty<string>();
 22
 53323            SkipSubtitlesIfAudioTrackMatches = true;
 53324            RequirePerfectSubtitleMatch = true;
 53325            AllowEmbeddedSubtitles = EmbeddedSubtitleOptions.AllowAll;
 26
 53327            AutomaticallyAddToCollection = false;
 53328            EnablePhotos = true;
 53329            SaveSubtitlesWithMedia = true;
 53330            SaveLyricsWithMedia = false;
 53331            SaveTrickplayWithMedia = false;
 53332            PathInfos = Array.Empty<MediaPathInfo>();
 53333            EnableAutomaticSeriesGrouping = true;
 53334            SeasonZeroDisplayName = "Specials";
 35
 53336            PreferNonstandardArtistsTag = false;
 53337            UseCustomTagDelimiters = false;
 53338            CustomTagDelimiters = _defaultTagDelimiters;
 53339            DelimiterWhitelist = Array.Empty<string>();
 53340        }
 41
 42        public bool Enabled { get; set; } = true;
 43
 44        public bool EnablePhotos { get; set; }
 45
 46        public bool EnableRealtimeMonitor { get; set; }
 47
 48        public bool EnableLUFSScan { get; set; }
 49
 50        public bool EnableChapterImageExtraction { get; set; }
 51
 52        public bool ExtractChapterImagesDuringLibraryScan { get; set; }
 53
 54        public bool EnableTrickplayImageExtraction { get; set; }
 55
 56        public bool ExtractTrickplayImagesDuringLibraryScan { get; set; }
 57
 58        public MediaPathInfo[] PathInfos { get; set; }
 59
 60        public bool SaveLocalMetadata { get; set; }
 61
 62        [Obsolete("Disable remote providers in TypeOptions instead")]
 63        public bool EnableInternetProviders { get; set; }
 64
 65        public bool EnableAutomaticSeriesGrouping { get; set; }
 66
 67        public bool EnableEmbeddedTitles { get; set; }
 68
 69        public bool EnableEmbeddedExtrasTitles { get; set; }
 70
 71        public bool EnableEmbeddedEpisodeInfos { get; set; }
 72
 73        public int AutomaticRefreshIntervalDays { get; set; }
 74
 75        /// <summary>
 76        /// Gets or sets the preferred metadata language.
 77        /// </summary>
 78        /// <value>The preferred metadata language.</value>
 79        public string? PreferredMetadataLanguage { get; set; }
 80
 81        /// <summary>
 82        /// Gets or sets the metadata country code.
 83        /// </summary>
 84        /// <value>The metadata country code.</value>
 85        public string? MetadataCountryCode { get; set; }
 86
 87        public string SeasonZeroDisplayName { get; set; }
 88
 89        public string[]? MetadataSavers { get; set; }
 90
 91        public string[] DisabledLocalMetadataReaders { get; set; }
 92
 93        public string[]? LocalMetadataReaderOrder { get; set; }
 94
 95        public string[] DisabledSubtitleFetchers { get; set; }
 96
 97        public string[] SubtitleFetcherOrder { get; set; }
 98
 99        public string[] DisabledMediaSegmentProviders { get; set; }
 100
 101        public string[] MediaSegmentProvideOrder { get; set; }
 102
 103        public bool SkipSubtitlesIfEmbeddedSubtitlesPresent { get; set; }
 104
 105        public bool SkipSubtitlesIfAudioTrackMatches { get; set; }
 106
 107        public string[]? SubtitleDownloadLanguages { get; set; }
 108
 109        public bool RequirePerfectSubtitleMatch { get; set; }
 110
 111        public bool SaveSubtitlesWithMedia { get; set; }
 112
 113        [DefaultValue(false)]
 114        public bool SaveLyricsWithMedia { get; set; }
 115
 116        [DefaultValue(false)]
 117        public bool SaveTrickplayWithMedia { get; set; }
 118
 119        public string[] DisabledLyricFetchers { get; set; }
 120
 121        public string[] LyricFetcherOrder { get; set; }
 122
 123        [DefaultValue(false)]
 124        public bool PreferNonstandardArtistsTag { get; set; }
 125
 126        [DefaultValue(false)]
 127        public bool UseCustomTagDelimiters { get; set; }
 128
 129        [DefaultValue(typeof(LibraryOptions), nameof(_defaultTagDelimiters))]
 130        public char[] CustomTagDelimiters { get; set; }
 131
 132        public string[] DelimiterWhitelist { get; set; }
 133
 134        public bool AutomaticallyAddToCollection { get; set; }
 135
 136        public EmbeddedSubtitleOptions AllowEmbeddedSubtitles { get; set; }
 137
 138        public TypeOptions[] TypeOptions { get; set; }
 139
 140        public TypeOptions? GetTypeOptions(string type)
 141        {
 406142            foreach (var options in TypeOptions)
 143            {
 40144                if (string.Equals(options.Type, type, StringComparison.OrdinalIgnoreCase))
 145                {
 40146                    return options;
 147                }
 148            }
 149
 143150            return null;
 151        }
 152    }
 153}