aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/ServerApplicationPaths.cs
diff options
context:
space:
mode:
authorcvium <clausvium@gmail.com>2021-09-05 10:11:17 +0200
committercvium <clausvium@gmail.com>2021-09-05 10:11:17 +0200
commitffe5ae8056d2f145bacae120b56fde39d132dc6f (patch)
tree174625f71dae8abd79fb87ca606b514c407b770c /Emby.Server.Implementations/ServerApplicationPaths.cs
parent417a7011c7b5fe4a5ca5ce7c0b61c14f15bc748b (diff)
parentff83fabac35a7bf8756a8d822b8f031d700dbb64 (diff)
Merge branch 'master' into TVFix
Diffstat (limited to 'Emby.Server.Implementations/ServerApplicationPaths.cs')
-rw-r--r--Emby.Server.Implementations/ServerApplicationPaths.cs10
1 files changed, 7 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/ServerApplicationPaths.cs b/Emby.Server.Implementations/ServerApplicationPaths.cs
index ac589b03c..6cf9a8f71 100644
--- a/Emby.Server.Implementations/ServerApplicationPaths.cs
+++ b/Emby.Server.Implementations/ServerApplicationPaths.cs
@@ -25,6 +25,10 @@ namespace Emby.Server.Implementations
cacheDirectoryPath,
webDirectoryPath)
{
+ // ProgramDataPath cannot change when the server is running, so cache these to avoid allocations.
+ RootFolderPath = Path.Join(ProgramDataPath, "root");
+ DefaultUserViewsPath = Path.Combine(RootFolderPath, "default");
+ DefaultInternalMetadataPath = Path.Combine(ProgramDataPath, "metadata");
InternalMetadataPath = DefaultInternalMetadataPath;
}
@@ -32,13 +36,13 @@ namespace Emby.Server.Implementations
/// Gets the path to the base root media directory.
/// </summary>
/// <value>The root folder path.</value>
- public string RootFolderPath => Path.Combine(ProgramDataPath, "root");
+ public string RootFolderPath { get; }
/// <summary>
/// Gets the path to the default user view directory. Used if no specific user view is defined.
/// </summary>
/// <value>The default user views path.</value>
- public string DefaultUserViewsPath => Path.Combine(RootFolderPath, "default");
+ public string DefaultUserViewsPath { get; }
/// <summary>
/// Gets the path to the People directory.
@@ -98,7 +102,7 @@ namespace Emby.Server.Implementations
public string UserConfigurationDirectoryPath => Path.Combine(ConfigurationDirectoryPath, "users");
/// <inheritdoc/>
- public string DefaultInternalMetadataPath => Path.Combine(ProgramDataPath, "metadata");
+ public string DefaultInternalMetadataPath { get; }
/// <inheritdoc />
public string InternalMetadataPath { get; set; }