aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/ServerApplicationPaths.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2021-06-12 00:20:54 +0200
committerGitHub <noreply@github.com>2021-06-12 00:20:54 +0200
commitcfad97ff28339088ab86c40661bb407024285a7c (patch)
tree152c04363e23e233229a7b40080d388a13046657 /Emby.Server.Implementations/ServerApplicationPaths.cs
parentadf406b1821800bbf1b214c4ac673defa362e4f4 (diff)
parent66de8428960ec751521386c27e37909cf73add9e (diff)
Merge pull request #6096 from cvium/saving_private_ram
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; }