< Summary - Jellyfin

Information
Class: Jellyfin.Server.StartupOptions
Assembly: jellyfin
File(s): /srv/git/jellyfin/Jellyfin.Server/StartupOptions.cs
Line coverage
60%
Covered lines: 6
Uncovered lines: 4
Coverable lines: 10
Total lines: 121
Line coverage: 60%
Branch coverage
50%
Covered branches: 4
Total branches: 8
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100 2/13/2026 - 12:11:21 AM Line coverage: 60% (6/10) Branch coverage: 50% (4/8) Total lines: 1135/7/2026 - 12:15:44 AM Line coverage: 60% (6/10) Branch coverage: 50% (4/8) Total lines: 121 2/13/2026 - 12:11:21 AM Line coverage: 60% (6/10) Branch coverage: 50% (4/8) Total lines: 1135/7/2026 - 12:15:44 AM Line coverage: 60% (6/10) Branch coverage: 50% (4/8) Total lines: 121

Coverage delta

Coverage delta 1 -1

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
ConvertToConfig()50%12860%

File(s)

/srv/git/jellyfin/Jellyfin.Server/StartupOptions.cs

#LineLine coverage
 1using System.Collections.Generic;
 2using CommandLine;
 3using Emby.Server.Implementations;
 4using Jellyfin.Server.Configuration;
 5using static MediaBrowser.Controller.Extensions.ConfigurationExtensions;
 6
 7namespace Jellyfin.Server
 8{
 9    /// <summary>
 10    /// Class used by CommandLine package when parsing the command line arguments.
 11    /// </summary>
 12    public class StartupOptions : IStartupOptions
 13    {
 14        /// <summary>
 15        /// Gets or sets the path to the data directory.
 16        /// </summary>
 17        /// <value>The path to the data directory.</value>
 18        [Option('d', "datadir", Required = false, HelpText = "Path to use for the data folder (database files, etc.).")]
 19        public string? DataDir { get; set; }
 20
 21        /// <summary>
 22        /// Gets or sets a value indicating whether the server should not host the web client.
 23        /// </summary>
 24        [Option("nowebclient", Required = false, HelpText = "Indicates that the web server should not host the web clien
 25        public bool NoWebClient { get; set; }
 26
 27        /// <summary>
 28        /// Gets or sets the path to the web directory.
 29        /// </summary>
 30        /// <value>The path to the web directory.</value>
 31        [Option('w', "webdir", Required = false, HelpText = "Path to the Jellyfin web UI resources.")]
 32        public string? WebDir { get; set; }
 33
 34        /// <summary>
 35        /// Gets or sets the path to the cache directory.
 36        /// </summary>
 37        /// <value>The path to the cache directory.</value>
 38        [Option('C', "cachedir", Required = false, HelpText = "Path to use for caching.")]
 39        public string? CacheDir { get; set; }
 40
 41        /// <summary>
 42        /// Gets or sets the path to the config directory.
 43        /// </summary>
 44        /// <value>The path to the config directory.</value>
 45        [Option('c', "configdir", Required = false, HelpText = "Path to use for configuration data (user settings and pi
 46        public string? ConfigDir { get; set; }
 47
 48        /// <summary>
 49        /// Gets or sets the path to the log directory.
 50        /// </summary>
 51        /// <value>The path to the log directory.</value>
 52        [Option('l', "logdir", Required = false, HelpText = "Path to use for writing log files.")]
 53        public string? LogDir { get; set; }
 54
 55        /// <inheritdoc />
 56        [Option("ffmpeg", Required = false, HelpText = "Path to external FFmpeg executable to use in place of default fo
 57        public string? FFmpegPath { get; set; }
 58
 59        /// <inheritdoc />
 60        [Option("service", Required = false, HelpText = "Run as headless service.")]
 61        public bool IsService { get; set; }
 62
 63        /// <inheritdoc />
 64        [Option("package-name", Required = false, HelpText = "Used when packaging Jellyfin (example, synology).")]
 65        public string? PackageName { get; set; }
 66
 67        /// <inheritdoc />
 68        [Option("published-server-url", Required = false, HelpText = "Jellyfin Server URL to publish via auto discover p
 69        public string? PublishedServerUrl { get; set; }
 70
 71        /// <summary>
 72        /// Gets or sets a value indicating whether the server should not detect network status change.
 73        /// </summary>
 74        [Option("nonetchange", Required = false, HelpText = "Indicates that the server should not detect network status 
 75        public bool NoDetectNetworkChange { get; set; }
 76
 77        /// <summary>
 78        /// Gets or sets the path to an jellyfin backup archive to restore the application to.
 79        /// </summary>
 80        [Option("restore-archive", Required = false, HelpText = "Path to a Jellyfin backup archive to restore from")]
 81        public string? RestoreArchive { get; set; }
 82
 83        /// <summary>
 84        /// Gets or sets the mode of operation the server should perform when started.
 85        /// Defaults to: <see cref="StartupMode.MediaServer"/>.
 86        /// </summary>
 87        [Option("mode", Required = false, HelpText = "Mode which selects what action the jellyfin server should perform 
 88        public StartupMode? StartupMode { get; set; }
 89
 90        /// <summary>
 91        /// Gets the command line options as a dictionary that can be used in the .NET configuration system.
 92        /// </summary>
 93        /// <returns>The configuration dictionary.</returns>
 94        public Dictionary<string, string?> ConvertToConfig()
 95        {
 4296            var config = new Dictionary<string, string?>();
 97
 4298            if (NoWebClient)
 99            {
 0100                config.Add(HostWebClientKey, bool.FalseString);
 101            }
 102
 42103            if (PublishedServerUrl is not null)
 104            {
 0105                config.Add(AddressOverrideKey, PublishedServerUrl);
 106            }
 107
 42108            if (FFmpegPath is not null)
 109            {
 0110                config.Add(FfmpegPathKey, FFmpegPath);
 111            }
 112
 42113            if (NoDetectNetworkChange)
 114            {
 0115                config.Add(DetectNetworkChangeKey, bool.FalseString);
 116            }
 117
 42118            return config;
 119        }
 120    }
 121}

Methods/Properties

ConvertToConfig()