ServerConfiguration.cs 11 KB

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