aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/ServerApplicationPaths.cs
diff options
context:
space:
mode:
authorBaronGreenback <jimcartlidge@yahoo.co.uk>2021-06-19 15:04:30 +0100
committerGitHub <noreply@github.com>2021-06-19 15:04:30 +0100
commit6648b7d7dabeaa84835fc7a8a7a2a468a00cad5c (patch)
tree4b3eeee4f10f5465eaee0110aa18452dab2f9f6d /Emby.Server.Implementations/ServerApplicationPaths.cs
parent97c2c523a89dabead25b5b0d028acbd92d136660 (diff)
parent0c3dcdf77b0d124517bffa608bfddf7d8f7682db (diff)
Merge branch 'master' into comparisons
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; }