< Summary - Jellyfin

Information
Class: Emby.Server.Implementations.AppBase.BaseApplicationPaths
Assembly: Emby.Server.Implementations
File(s): /srv/git/jellyfin/Emby.Server.Implementations/AppBase/BaseApplicationPaths.cs
Line coverage
88%
Covered lines: 8
Uncovered lines: 1
Coverable lines: 9
Total lines: 109
Line coverage: 88.8%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
get_VirtualDataPath()100%11100%
get_ImageCachePath()100%210%
get_PluginsPath()100%11100%
get_PluginConfigurationsPath()100%11100%
get_SystemConfigurationFilePath()100%11100%
get_TempDirectory()100%11100%

File(s)

/srv/git/jellyfin/Emby.Server.Implementations/AppBase/BaseApplicationPaths.cs

#LineLine coverage
 1using System;
 2using System.IO;
 3using MediaBrowser.Common.Configuration;
 4
 5namespace Emby.Server.Implementations.AppBase
 6{
 7    /// <summary>
 8    /// Provides a base class to hold common application paths used by both the UI and Server.
 9    /// This can be subclassed to add application-specific paths.
 10    /// </summary>
 11    public abstract class BaseApplicationPaths : IApplicationPaths
 12    {
 13        /// <summary>
 14        /// Initializes a new instance of the <see cref="BaseApplicationPaths"/> class.
 15        /// </summary>
 16        /// <param name="programDataPath">The program data path.</param>
 17        /// <param name="logDirectoryPath">The log directory path.</param>
 18        /// <param name="configurationDirectoryPath">The configuration directory path.</param>
 19        /// <param name="cacheDirectoryPath">The cache directory path.</param>
 20        /// <param name="webDirectoryPath">The web directory path.</param>
 21        protected BaseApplicationPaths(
 22            string programDataPath,
 23            string logDirectoryPath,
 24            string configurationDirectoryPath,
 25            string cacheDirectoryPath,
 26            string webDirectoryPath)
 27        {
 28            ProgramDataPath = programDataPath;
 29            LogDirectoryPath = logDirectoryPath;
 30            ConfigurationDirectoryPath = configurationDirectoryPath;
 2231            CachePath = cacheDirectoryPath;
 32            WebPath = webDirectoryPath;
 33
 2234            DataPath = Directory.CreateDirectory(Path.Combine(ProgramDataPath, "data")).FullName;
 2235        }
 36
 37        /// <summary>
 38        /// Gets the path to the program data folder.
 39        /// </summary>
 40        /// <value>The program data path.</value>
 41        public string ProgramDataPath { get; }
 42
 43        /// <inheritdoc/>
 44        public string WebPath { get; }
 45
 46        /// <summary>
 47        /// Gets the path to the system folder.
 48        /// </summary>
 49        /// <value>The path to the system folder.</value>
 50        public string ProgramSystemPath { get; } = AppContext.BaseDirectory;
 51
 52        /// <summary>
 53        /// Gets the folder path to the data directory.
 54        /// </summary>
 55        /// <value>The data directory.</value>
 56        public string DataPath { get; }
 57
 58        /// <inheritdoc />
 14559        public string VirtualDataPath => "%AppDataPath%";
 60
 61        /// <summary>
 62        /// Gets the image cache path.
 63        /// </summary>
 64        /// <value>The image cache path.</value>
 065        public string ImageCachePath => Path.Combine(CachePath, "images");
 66
 67        /// <summary>
 68        /// Gets the path to the plugin directory.
 69        /// </summary>
 70        /// <value>The plugins path.</value>
 30871        public string PluginsPath => Path.Combine(ProgramDataPath, "plugins");
 72
 73        /// <summary>
 74        /// Gets the path to the plugin configurations directory.
 75        /// </summary>
 76        /// <value>The plugin configurations path.</value>
 13277        public string PluginConfigurationsPath => Path.Combine(PluginsPath, "configurations");
 78
 79        /// <summary>
 80        /// Gets the path to the log directory.
 81        /// </summary>
 82        /// <value>The log directory path.</value>
 83        public string LogDirectoryPath { get; }
 84
 85        /// <summary>
 86        /// Gets the path to the application configuration root directory.
 87        /// </summary>
 88        /// <value>The configuration directory path.</value>
 89        public string ConfigurationDirectoryPath { get; }
 90
 91        /// <summary>
 92        /// Gets the path to the system configuration file.
 93        /// </summary>
 94        /// <value>The system configuration file path.</value>
 6295        public string SystemConfigurationFilePath => Path.Combine(ConfigurationDirectoryPath, "system.xml");
 96
 97        /// <summary>
 98        /// Gets or sets the folder path to the cache directory.
 99        /// </summary>
 100        /// <value>The cache directory.</value>
 101        public string CachePath { get; set; }
 102
 103        /// <summary>
 104        /// Gets the folder path to the temp directory within the cache folder.
 105        /// </summary>
 106        /// <value>The temp directory.</value>
 68107        public string TempDirectory => Path.Join(Path.GetTempPath(), "jellyfin");
 108    }
 109}