ServerApplicationPaths.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. using System.IO;
  2. using Emby.Server.Implementations.AppBase;
  3. using MediaBrowser.Controller;
  4. namespace Emby.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="ServerApplicationPaths" /> class.
  13. /// </summary>
  14. public ServerApplicationPaths(
  15. string programDataPath,
  16. string logDirectoryPath,
  17. string configurationDirectoryPath,
  18. string cacheDirectoryPath,
  19. string webDirectoryPath)
  20. : base(
  21. programDataPath,
  22. logDirectoryPath,
  23. configurationDirectoryPath,
  24. cacheDirectoryPath,
  25. webDirectoryPath)
  26. {
  27. InternalMetadataPath = DefaultInternalMetadataPath;
  28. }
  29. /// <summary>
  30. /// Gets the path to the base root media directory.
  31. /// </summary>
  32. /// <value>The root folder path.</value>
  33. public string RootFolderPath => Path.Combine(ProgramDataPath, "root");
  34. /// <summary>
  35. /// Gets the path to the default user view directory. Used if no specific user view is defined.
  36. /// </summary>
  37. /// <value>The default user views path.</value>
  38. public string DefaultUserViewsPath => Path.Combine(RootFolderPath, "default");
  39. /// <summary>
  40. /// Gets the path to the People directory.
  41. /// </summary>
  42. /// <value>The people path.</value>
  43. public string PeoplePath => Path.Combine(InternalMetadataPath, "People");
  44. /// <inheritdoc />
  45. public string ArtistsPath => Path.Combine(InternalMetadataPath, "artists");
  46. /// <summary>
  47. /// Gets the path to the Genre directory.
  48. /// </summary>
  49. /// <value>The genre path.</value>
  50. public string GenrePath => Path.Combine(InternalMetadataPath, "Genre");
  51. /// <summary>
  52. /// Gets the path to the Genre directory.
  53. /// </summary>
  54. /// <value>The genre path.</value>
  55. public string MusicGenrePath => Path.Combine(InternalMetadataPath, "MusicGenre");
  56. /// <summary>
  57. /// Gets the path to the Studio directory.
  58. /// </summary>
  59. /// <value>The studio path.</value>
  60. public string StudioPath => Path.Combine(InternalMetadataPath, "Studio");
  61. /// <summary>
  62. /// Gets the path to the Year directory.
  63. /// </summary>
  64. /// <value>The year path.</value>
  65. public string YearPath => Path.Combine(InternalMetadataPath, "Year");
  66. /// <summary>
  67. /// Gets the path to the General IBN directory.
  68. /// </summary>
  69. /// <value>The general path.</value>
  70. public string GeneralPath => Path.Combine(InternalMetadataPath, "general");
  71. /// <summary>
  72. /// Gets the path to the Ratings IBN directory.
  73. /// </summary>
  74. /// <value>The ratings path.</value>
  75. public string RatingsPath => Path.Combine(InternalMetadataPath, "ratings");
  76. /// <summary>
  77. /// Gets the media info images path.
  78. /// </summary>
  79. /// <value>The media info images path.</value>
  80. public string MediaInfoImagesPath => Path.Combine(InternalMetadataPath, "mediainfo");
  81. /// <summary>
  82. /// Gets the path to the user configuration directory.
  83. /// </summary>
  84. /// <value>The user configuration directory path.</value>
  85. public string UserConfigurationDirectoryPath => Path.Combine(ConfigurationDirectoryPath, "users");
  86. /// <inheritdoc/>
  87. public string DefaultInternalMetadataPath => Path.Combine(ProgramDataPath, "metadata");
  88. /// <inheritdoc />
  89. public string InternalMetadataPath { get; set; }
  90. /// <inheritdoc />
  91. public string VirtualInternalMetadataPath { get; } = "%MetadataPath%";
  92. }
  93. }