aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Configuration/LibraryOptions.cs
blob: c956bee47a39bf72f9a0d30f3224d872a1baa114 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#pragma warning disable CS1591

using System;
using System.ComponentModel;

namespace MediaBrowser.Model.Configuration
{
    public class LibraryOptions
    {
        public LibraryOptions()
        {
            TypeOptions = Array.Empty<TypeOptions>();
            DisabledSubtitleFetchers = Array.Empty<string>();
            SubtitleFetcherOrder = Array.Empty<string>();
            DisabledLocalMetadataReaders = Array.Empty<string>();

            SkipSubtitlesIfAudioTrackMatches = true;
            RequirePerfectSubtitleMatch = true;
            AllowEmbeddedSubtitles = EmbeddedSubtitleOptions.AllowAll;

            AutomaticallyAddToCollection = false;
            EnablePhotos = true;
            SaveSubtitlesWithMedia = true;
            SaveLyricsWithMedia = false;
            PathInfos = Array.Empty<MediaPathInfo>();
            EnableAutomaticSeriesGrouping = true;
            SeasonZeroDisplayName = "Specials";
        }

        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 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; }

        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;
        }
    }
}