ServerConfiguration.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. using MediaBrowser.Model.Weather;
  2. using ProtoBuf;
  3. using System;
  4. namespace MediaBrowser.Model.Configuration
  5. {
  6. /// <summary>
  7. /// Represents the server configuration.
  8. /// </summary>
  9. [ProtoContract]
  10. public class ServerConfiguration : BaseApplicationConfiguration
  11. {
  12. /// <summary>
  13. /// Gets or sets a value indicating whether [enable internet providers].
  14. /// </summary>
  15. /// <value><c>true</c> if [enable internet providers]; otherwise, <c>false</c>.</value>
  16. [ProtoMember(6)]
  17. public bool EnableInternetProviders { get; set; }
  18. /// <summary>
  19. /// Gets or sets the zip code to use when displaying weather
  20. /// </summary>
  21. /// <value>The weather location.</value>
  22. [ProtoMember(7)]
  23. public string WeatherLocation { get; set; }
  24. /// <summary>
  25. /// Gets or sets the weather unit to use when displaying weather
  26. /// </summary>
  27. /// <value>The weather unit.</value>
  28. [ProtoMember(8)]
  29. public WeatherUnits WeatherUnit { get; set; }
  30. /// <summary>
  31. /// Gets or sets the metadata refresh days.
  32. /// </summary>
  33. /// <value>The metadata refresh days.</value>
  34. [ProtoMember(9)]
  35. public int MetadataRefreshDays { get; set; }
  36. /// <summary>
  37. /// Gets or sets a value indicating whether [save local meta].
  38. /// </summary>
  39. /// <value><c>true</c> if [save local meta]; otherwise, <c>false</c>.</value>
  40. [ProtoMember(10)]
  41. public bool SaveLocalMeta { get; set; }
  42. /// <summary>
  43. /// Gets or sets a value indicating whether [refresh item images].
  44. /// </summary>
  45. /// <value><c>true</c> if [refresh item images]; otherwise, <c>false</c>.</value>
  46. [ProtoMember(11)]
  47. public bool RefreshItemImages { get; set; }
  48. /// <summary>
  49. /// Gets or sets the preferred metadata language.
  50. /// </summary>
  51. /// <value>The preferred metadata language.</value>
  52. [ProtoMember(12)]
  53. public string PreferredMetadataLanguage { get; set; }
  54. /// <summary>
  55. /// Gets or sets the metadata country code.
  56. /// </summary>
  57. /// <value>The metadata country code.</value>
  58. [ProtoMember(13)]
  59. public string MetadataCountryCode { get; set; }
  60. /// <summary>
  61. /// Gets or sets the size of the TMDB fetched poster.
  62. /// </summary>
  63. /// <value>The size of the TMDB fetched poster.</value>
  64. [ProtoMember(14)]
  65. public string TmdbFetchedPosterSize { get; set; }
  66. /// <summary>
  67. /// Gets or sets the size of the TMDB fetched profile.
  68. /// </summary>
  69. /// <value>The size of the TMDB fetched profile.</value>
  70. [ProtoMember(15)]
  71. public string TmdbFetchedProfileSize { get; set; }
  72. /// <summary>
  73. /// Gets or sets the size of the TMDB fetched backdrop.
  74. /// </summary>
  75. /// <value>The size of the TMDB fetched backdrop.</value>
  76. [ProtoMember(16)]
  77. public string TmdbFetchedBackdropSize { get; set; }
  78. /// <summary>
  79. /// Gets or sets the max backdrops.
  80. /// </summary>
  81. /// <value>The max backdrops.</value>
  82. [ProtoMember(17)]
  83. public int MaxBackdrops { get; set; }
  84. /// <summary>
  85. /// Gets or sets a value indicating whether [download movie art].
  86. /// </summary>
  87. /// <value><c>true</c> if [download movie art]; otherwise, <c>false</c>.</value>
  88. [ProtoMember(40)]
  89. public bool DownloadMovieArt { get; set; }
  90. /// <summary>
  91. /// Gets or sets a value indicating whether [download movie logo].
  92. /// </summary>
  93. /// <value><c>true</c> if [download movie logo]; otherwise, <c>false</c>.</value>
  94. [ProtoMember(41)]
  95. public bool DownloadMovieLogo { get; set; }
  96. /// <summary>
  97. /// Gets or sets a value indicating whether [download movie disc].
  98. /// </summary>
  99. /// <value><c>true</c> if [download movie disc]; otherwise, <c>false</c>.</value>
  100. [ProtoMember(42)]
  101. public bool DownloadMovieDisc { get; set; }
  102. /// <summary>
  103. /// Gets or sets a value indicating whether [download TV art].
  104. /// </summary>
  105. /// <value><c>true</c> if [download TV art]; otherwise, <c>false</c>.</value>
  106. [ProtoMember(43)]
  107. public bool DownloadTVArt { get; set; }
  108. /// <summary>
  109. /// Gets or sets a value indicating whether [download TV logo].
  110. /// </summary>
  111. /// <value><c>true</c> if [download TV logo]; otherwise, <c>false</c>.</value>
  112. [ProtoMember(44)]
  113. public bool DownloadTVLogo { get; set; }
  114. /// <summary>
  115. /// Gets or sets a value indicating whether [download TV thumb].
  116. /// </summary>
  117. /// <value><c>true</c> if [download TV thumb]; otherwise, <c>false</c>.</value>
  118. [ProtoMember(45)]
  119. public bool DownloadTVThumb { get; set; }
  120. /// <summary>
  121. /// Gets or sets a value indicating whether [download movie banner].
  122. /// </summary>
  123. /// <value><c>true</c> if [download movie banner]; otherwise, <c>false</c>.</value>
  124. [ProtoMember(46)]
  125. public bool DownloadMovieBanner { get; set; }
  126. /// <summary>
  127. /// Gets or sets a value indicating whether [download movie thumb].
  128. /// </summary>
  129. /// <value><c>true</c> if [download movie thumb]; otherwise, <c>false</c>.</value>
  130. [ProtoMember(47)]
  131. public bool DownloadMovieThumb { get; set; }
  132. /// <summary>
  133. /// Gets or sets a value indicating whether [download TV banner].
  134. /// </summary>
  135. /// <value><c>true</c> if [download TV banner]; otherwise, <c>false</c>.</value>
  136. [ProtoMember(48)]
  137. public bool DownloadTVBanner { get; set; }
  138. /// <summary>
  139. /// Gets or sets a value indicating whether [download TV season banner].
  140. /// </summary>
  141. /// <value><c>true</c> if [download TV season banner]; otherwise, <c>false</c>.</value>
  142. [ProtoMember(49)]
  143. public bool DownloadTVSeasonBanner { get; set; }
  144. /// <summary>
  145. /// Gets or sets a value indicating whether [download TV season thumb].
  146. /// </summary>
  147. /// <value><c>true</c> if [download TV season thumb]; otherwise, <c>false</c>.</value>
  148. [ProtoMember(50)]
  149. public bool DownloadTVSeasonThumb { get; set; }
  150. /// <summary>
  151. /// Gets or sets a value indicating whether [download TV season backdrops].
  152. /// </summary>
  153. /// <value><c>true</c> if [download TV season banner]; otherwise, <c>false</c>.</value>
  154. [ProtoMember(51)]
  155. public bool DownloadTVSeasonBackdrops { get; set; }
  156. /// <summary>
  157. /// Gets or sets a value indicating whether [download TV season backdrops].
  158. /// </summary>
  159. /// <value><c>true</c> if [download TV season banner]; otherwise, <c>false</c>.</value>
  160. [ProtoMember(52)]
  161. public bool DownloadHDFanArt { get; set; }
  162. /// <summary>
  163. /// Gets or sets the name of the item repository that should be used
  164. /// </summary>
  165. /// <value>The item repository.</value>
  166. [ProtoMember(24)]
  167. public string ItemRepository { get; set; }
  168. /// <summary>
  169. /// Gets or sets the name of the user repository that should be used
  170. /// </summary>
  171. /// <value>The user repository.</value>
  172. [ProtoMember(25)]
  173. public string UserRepository { get; set; }
  174. /// <summary>
  175. /// Gets or sets the name of the user data repository that should be used
  176. /// </summary>
  177. /// <value>The user data repository.</value>
  178. [ProtoMember(26)]
  179. public string UserDataRepository { get; set; }
  180. /// <summary>
  181. /// Characters to be replaced with a ' ' in strings to create a sort name
  182. /// </summary>
  183. /// <value>The sort replace characters.</value>
  184. [ProtoMember(27)]
  185. public string[] SortReplaceCharacters { get; set; }
  186. /// <summary>
  187. /// Characters to be removed from strings to create a sort name
  188. /// </summary>
  189. /// <value>The sort remove characters.</value>
  190. [ProtoMember(28)]
  191. public string[] SortRemoveCharacters { get; set; }
  192. /// <summary>
  193. /// Words to be removed from strings to create a sort name
  194. /// </summary>
  195. /// <value>The sort remove words.</value>
  196. [ProtoMember(29)]
  197. public string[] SortRemoveWords { get; set; }
  198. /// <summary>
  199. /// Show an output log window for debugging
  200. /// </summary>
  201. /// <value><c>true</c> if [show log window]; otherwise, <c>false</c>.</value>
  202. [ProtoMember(30)]
  203. public bool ShowLogWindow { get; set; }
  204. /// <summary>
  205. /// Gets or sets the name of the user data repository that should be used
  206. /// </summary>
  207. /// <value>The display preferences repository.</value>
  208. [ProtoMember(31)]
  209. public string DisplayPreferencesRepository { get; set; }
  210. /// <summary>
  211. /// The list of types that will NOT be allowed to have internet providers run against them even if they are turned on.
  212. /// </summary>
  213. /// <value>The internet provider exclude types.</value>
  214. [ProtoMember(32)]
  215. public string[] InternetProviderExcludeTypes { get; set; }
  216. /// <summary>
  217. /// Gets or sets the recent item days.
  218. /// </summary>
  219. /// <value>The recent item days.</value>
  220. [ProtoMember(34)]
  221. public int RecentItemDays { get; set; }
  222. /// <summary>
  223. /// Gets or sets the recently played days.
  224. /// </summary>
  225. /// <value>The recently played days.</value>
  226. [ProtoMember(35)]
  227. public int RecentlyPlayedDays { get; set; }
  228. /// <summary>
  229. /// Gets or sets the minimum percentage of an item that must be played in order for playstate to be updated.
  230. /// </summary>
  231. /// <value>The min resume PCT.</value>
  232. [ProtoMember(36)]
  233. public int MinResumePct { get; set; }
  234. /// <summary>
  235. /// 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.
  236. /// </summary>
  237. /// <value>The max resume PCT.</value>
  238. [ProtoMember(37)]
  239. public int MaxResumePct { get; set; }
  240. /// <summary>
  241. /// Gets or sets the minimum duration that an item must have in order to be eligible for playstate updates..
  242. /// </summary>
  243. /// <value>The min resume duration seconds.</value>
  244. [ProtoMember(38)]
  245. public int MinResumeDurationSeconds { get; set; }
  246. /// <summary>
  247. /// The delay in seconds that we will wait after a file system change to try and discover what has been added/removed
  248. /// Some delay is necessary with some items because their creation is not atomic. It involves the creation of several
  249. /// different directories and files.
  250. /// </summary>
  251. /// <value>The file watcher delay.</value>
  252. [ProtoMember(55)]
  253. public int FileWatcherDelay { get; set; }
  254. /// <summary>
  255. /// Gets or sets a value indicating whether [enable developer tools].
  256. /// </summary>
  257. /// <value><c>true</c> if [enable developer tools]; otherwise, <c>false</c>.</value>
  258. [ProtoMember(57)]
  259. public bool EnableDeveloperTools { get; set; }
  260. // Next Proto number ====> 59
  261. /// <summary>
  262. /// Initializes a new instance of the <see cref="ServerConfiguration" /> class.
  263. /// </summary>
  264. public ServerConfiguration()
  265. : base()
  266. {
  267. #if (DEBUG)
  268. EnableDeveloperTools = true;
  269. #endif
  270. MinResumePct = 5;
  271. MaxResumePct = 90;
  272. MinResumeDurationSeconds = Convert.ToInt32(TimeSpan.FromMinutes(5).TotalSeconds);
  273. FileWatcherDelay = 8;
  274. RecentItemDays = 14;
  275. RecentlyPlayedDays = 14;
  276. EnableInternetProviders = true; //initial installs will need these
  277. InternetProviderExcludeTypes = new string[] { };
  278. MetadataRefreshDays = 30;
  279. PreferredMetadataLanguage = "en";
  280. MetadataCountryCode = "US";
  281. TmdbFetchedProfileSize = "w185"; //w185 w45 h632 or original
  282. TmdbFetchedPosterSize = "w500"; //w500, w342, w185 or original
  283. TmdbFetchedBackdropSize = "w1280"; //w1280, w780 or original
  284. DownloadTVSeasonBanner = true;
  285. DownloadTVBanner = true;
  286. DownloadHDFanArt = true;
  287. MaxBackdrops = 4;
  288. SortReplaceCharacters = new [] { ".", "+", "%" };
  289. SortRemoveCharacters = new [] { ",", "&", "-", "{", "}", "'" };
  290. SortRemoveWords = new [] { "the", "a", "an" };
  291. }
  292. }
  293. }