< Summary - Jellyfin

Information
Class: Emby.Server.Implementations.ServerApplicationPaths
Assembly: Emby.Server.Implementations
File(s): /srv/git/jellyfin/Emby.Server.Implementations/ServerApplicationPaths.cs
Line coverage
68%
Covered lines: 13
Uncovered lines: 6
Coverable lines: 19
Total lines: 100
Line coverage: 68.4%
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_PeoplePath()100%11100%
get_ArtistsPath()100%210%
get_GenrePath()100%210%
get_MusicGenrePath()100%210%
get_StudioPath()100%210%
get_YearPath()100%210%
get_UserConfigurationDirectoryPath()100%210%
get_VirtualInternalMetadataPath()100%11100%

File(s)

/srv/git/jellyfin/Emby.Server.Implementations/ServerApplicationPaths.cs

#LineLine coverage
 1using System.IO;
 2using Emby.Server.Implementations.AppBase;
 3using MediaBrowser.Controller;
 4
 5namespace Emby.Server.Implementations
 6{
 7    /// <summary>
 8    /// Extends BaseApplicationPaths to add paths that are only applicable on the server.
 9    /// </summary>
 10    public class ServerApplicationPaths : BaseApplicationPaths, IServerApplicationPaths
 11    {
 12        /// <summary>
 13        /// Initializes a new instance of the <see cref="ServerApplicationPaths" /> class.
 14        /// </summary>
 15        /// <param name="programDataPath">The path for Jellyfin's data.</param>
 16        /// <param name="logDirectoryPath">The path for Jellyfin's logging directory.</param>
 17        /// <param name="configurationDirectoryPath">The path for Jellyfin's configuration directory.</param>
 18        /// <param name="cacheDirectoryPath">The path for Jellyfin's cache directory.</param>
 19        /// <param name="webDirectoryPath">The path for Jellyfin's web UI.</param>
 20        public ServerApplicationPaths(
 21            string programDataPath,
 22            string logDirectoryPath,
 23            string configurationDirectoryPath,
 24            string cacheDirectoryPath,
 25            string webDirectoryPath)
 2226            : base(
 2227                programDataPath,
 2228                logDirectoryPath,
 2229                configurationDirectoryPath,
 2230                cacheDirectoryPath,
 2231                webDirectoryPath)
 32        {
 33            // ProgramDataPath cannot change when the server is running, so cache these to avoid allocations.
 2234            RootFolderPath = Path.Join(ProgramDataPath, "root");
 2235            DefaultUserViewsPath = Path.Combine(RootFolderPath, "default");
 2236            DefaultInternalMetadataPath = Path.Combine(ProgramDataPath, "metadata");
 2237            InternalMetadataPath = DefaultInternalMetadataPath;
 2238        }
 39
 40        /// <summary>
 41        /// Gets the path to the base root media directory.
 42        /// </summary>
 43        /// <value>The root folder path.</value>
 44        public string RootFolderPath { get; }
 45
 46        /// <summary>
 47        /// Gets the path to the default user view directory.  Used if no specific user view is defined.
 48        /// </summary>
 49        /// <value>The default user views path.</value>
 50        public string DefaultUserViewsPath { get; }
 51
 52        /// <summary>
 53        /// Gets the path to the People directory.
 54        /// </summary>
 55        /// <value>The people path.</value>
 156        public string PeoplePath => Path.Combine(InternalMetadataPath, "People");
 57
 58        /// <inheritdoc />
 059        public string ArtistsPath => Path.Combine(InternalMetadataPath, "artists");
 60
 61        /// <summary>
 62        /// Gets the path to the Genre directory.
 63        /// </summary>
 64        /// <value>The genre path.</value>
 065        public string GenrePath => Path.Combine(InternalMetadataPath, "Genre");
 66
 67        /// <summary>
 68        /// Gets the path to the Genre directory.
 69        /// </summary>
 70        /// <value>The genre path.</value>
 071        public string MusicGenrePath => Path.Combine(InternalMetadataPath, "MusicGenre");
 72
 73        /// <summary>
 74        /// Gets the path to the Studio directory.
 75        /// </summary>
 76        /// <value>The studio path.</value>
 077        public string StudioPath => Path.Combine(InternalMetadataPath, "Studio");
 78
 79        /// <summary>
 80        /// Gets the path to the Year directory.
 81        /// </summary>
 82        /// <value>The year path.</value>
 083        public string YearPath => Path.Combine(InternalMetadataPath, "Year");
 84
 85        /// <summary>
 86        /// Gets the path to the user configuration directory.
 87        /// </summary>
 88        /// <value>The user configuration directory path.</value>
 089        public string UserConfigurationDirectoryPath => Path.Combine(ConfigurationDirectoryPath, "users");
 90
 91        /// <inheritdoc/>
 92        public string DefaultInternalMetadataPath { get; }
 93
 94        /// <inheritdoc />
 95        public string InternalMetadataPath { get; set; }
 96
 97        /// <inheritdoc />
 14598        public string VirtualInternalMetadataPath => "%MetadataPath%";
 99    }
 100}