ServerApplicationPaths.cs 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. using MediaBrowser.Common.Implementations;
  2. using MediaBrowser.Controller;
  3. using System.IO;
  4. namespace MediaBrowser.Server.Implementations
  5. {
  6. /// <summary>
  7. /// Extends BaseApplicationPaths to add paths that are only applicable on the server
  8. /// </summary>
  9. public class ServerApplicationPaths : BaseApplicationPaths, IServerApplicationPaths
  10. {
  11. /// <summary>
  12. /// Initializes a new instance of the <see cref="BaseApplicationPaths" /> class.
  13. /// </summary>
  14. public ServerApplicationPaths(string programDataPath, string applicationPath)
  15. : base(programDataPath, applicationPath)
  16. {
  17. }
  18. /// <summary>
  19. /// Gets the path to the base root media directory
  20. /// </summary>
  21. /// <value>The root folder path.</value>
  22. public string RootFolderPath
  23. {
  24. get
  25. {
  26. return Path.Combine(ProgramDataPath, "root");
  27. }
  28. }
  29. /// <summary>
  30. /// Gets the path to the default user view directory. Used if no specific user view is defined.
  31. /// </summary>
  32. /// <value>The default user views path.</value>
  33. public string DefaultUserViewsPath
  34. {
  35. get
  36. {
  37. return Path.Combine(RootFolderPath, "default");
  38. }
  39. }
  40. /// <summary>
  41. /// Gets the path to localization data.
  42. /// </summary>
  43. /// <value>The localization path.</value>
  44. public string LocalizationPath
  45. {
  46. get
  47. {
  48. return Path.Combine(ProgramDataPath, "localization");
  49. }
  50. }
  51. /// <summary>
  52. /// The _ibn path
  53. /// </summary>
  54. private string _ibnPath;
  55. /// <summary>
  56. /// Gets the path to the Images By Name directory
  57. /// </summary>
  58. /// <value>The images by name path.</value>
  59. public string ItemsByNamePath
  60. {
  61. get
  62. {
  63. return _ibnPath ?? (_ibnPath = Path.Combine(ProgramDataPath, "ImagesByName"));
  64. }
  65. set
  66. {
  67. _ibnPath = value;
  68. }
  69. }
  70. /// <summary>
  71. /// Gets the path to the People directory
  72. /// </summary>
  73. /// <value>The people path.</value>
  74. public string PeoplePath
  75. {
  76. get
  77. {
  78. return Path.Combine(ItemsByNamePath, "People");
  79. }
  80. }
  81. /// <summary>
  82. /// Gets the path to the Genre directory
  83. /// </summary>
  84. /// <value>The genre path.</value>
  85. public string GenrePath
  86. {
  87. get
  88. {
  89. return Path.Combine(ItemsByNamePath, "Genre");
  90. }
  91. }
  92. /// <summary>
  93. /// Gets the path to the Genre directory
  94. /// </summary>
  95. /// <value>The genre path.</value>
  96. public string MusicGenrePath
  97. {
  98. get
  99. {
  100. return Path.Combine(ItemsByNamePath, "MusicGenre");
  101. }
  102. }
  103. /// <summary>
  104. /// Gets the path to the Studio directory
  105. /// </summary>
  106. /// <value>The studio path.</value>
  107. public string StudioPath
  108. {
  109. get
  110. {
  111. return Path.Combine(ItemsByNamePath, "Studio");
  112. }
  113. }
  114. /// <summary>
  115. /// Gets the path to the Year directory
  116. /// </summary>
  117. /// <value>The year path.</value>
  118. public string YearPath
  119. {
  120. get
  121. {
  122. return Path.Combine(ItemsByNamePath, "Year");
  123. }
  124. }
  125. /// <summary>
  126. /// Gets the path to the General IBN directory
  127. /// </summary>
  128. /// <value>The general path.</value>
  129. public string GeneralPath
  130. {
  131. get
  132. {
  133. return Path.Combine(ItemsByNamePath, "general");
  134. }
  135. }
  136. /// <summary>
  137. /// Gets the path to the Ratings IBN directory
  138. /// </summary>
  139. /// <value>The ratings path.</value>
  140. public string RatingsPath
  141. {
  142. get
  143. {
  144. return Path.Combine(ItemsByNamePath, "ratings");
  145. }
  146. }
  147. /// <summary>
  148. /// Gets the media info images path.
  149. /// </summary>
  150. /// <value>The media info images path.</value>
  151. public string MediaInfoImagesPath
  152. {
  153. get
  154. {
  155. return Path.Combine(ItemsByNamePath, "mediainfo");
  156. }
  157. }
  158. /// <summary>
  159. /// Gets the path to the user configuration directory
  160. /// </summary>
  161. /// <value>The user configuration directory path.</value>
  162. public string UserConfigurationDirectoryPath
  163. {
  164. get
  165. {
  166. return Path.Combine(ConfigurationDirectoryPath, "users");
  167. }
  168. }
  169. private string _transcodingTempPath;
  170. public string TranscodingTempPath
  171. {
  172. get
  173. {
  174. return _transcodingTempPath ?? (_transcodingTempPath = Path.Combine(ProgramDataPath, "transcoding-temp"));
  175. }
  176. set
  177. {
  178. _transcodingTempPath = value;
  179. }
  180. }
  181. /// <summary>
  182. /// Gets the artists path.
  183. /// </summary>
  184. /// <value>The artists path.</value>
  185. public string ArtistsPath
  186. {
  187. get
  188. {
  189. return Path.Combine(ItemsByNamePath, "artists");
  190. }
  191. }
  192. /// <summary>
  193. /// Gets the game genre path.
  194. /// </summary>
  195. /// <value>The game genre path.</value>
  196. public string GameGenrePath
  197. {
  198. get
  199. {
  200. return Path.Combine(ItemsByNamePath, "GameGenre");
  201. }
  202. }
  203. private string _internalMetadataPath;
  204. public string InternalMetadataPath
  205. {
  206. get
  207. {
  208. return _internalMetadataPath ?? (_internalMetadataPath = Path.Combine(DataPath, "metadata"));
  209. }
  210. set
  211. {
  212. _internalMetadataPath = value;
  213. }
  214. }
  215. }
  216. }