< Summary - Jellyfin

Information
Class: MediaBrowser.MediaEncoding.Encoder.EncodingUtils
Assembly: MediaBrowser.MediaEncoding
File(s): /srv/git/jellyfin/MediaBrowser.MediaEncoding/Encoder/EncodingUtils.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 14
Coverable lines: 14
Total lines: 73
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 8
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100 5/12/2026 - 12:15:57 AM Line coverage: 0% (0/15) Branch coverage: 0% (0/8) Total lines: 8410/29/2026 - 12:17:11 AM Line coverage: 0% (0/14) Branch coverage: 0% (0/8) Total lines: 73 5/12/2026 - 12:15:57 AM Line coverage: 0% (0/15) Branch coverage: 0% (0/8) Total lines: 8410/29/2026 - 12:17:11 AM Line coverage: 0% (0/14) Branch coverage: 0% (0/8) Total lines: 73

Coverage delta

Coverage delta 1 -1

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
GetInputArgument(...)0%620%
GetInputArgument(...)0%620%
GetConcatInputArgument(...)0%620%
GetFileInputArgument(...)0%620%

File(s)

/srv/git/jellyfin/MediaBrowser.MediaEncoding/Encoder/EncodingUtils.cs

#LineLine coverage
 1#pragma warning disable CS1591
 2
 3using System;
 4using System.Collections.Generic;
 5using System.Globalization;
 6using System.Linq;
 7using Jellyfin.Extensions;
 8using MediaBrowser.Model.MediaInfo;
 9
 10namespace MediaBrowser.MediaEncoding.Encoder
 11{
 12    public static class EncodingUtils
 13    {
 14        public static string GetInputArgument(string inputPrefix, string inputFile, MediaProtocol protocol)
 15        {
 016            if (protocol != MediaProtocol.File)
 17            {
 018                return string.Format(CultureInfo.InvariantCulture, "\"{0}\"", inputFile);
 19            }
 20
 021            return GetFileInputArgument(inputFile, inputPrefix);
 22        }
 23
 24        public static string GetInputArgument(string inputPrefix, IReadOnlyList<string> inputFiles, MediaProtocol protoc
 25        {
 026            if (protocol != MediaProtocol.File)
 27            {
 028                return string.Format(CultureInfo.InvariantCulture, "\"{0}\"", inputFiles[0]);
 29            }
 30
 031            return GetConcatInputArgument(inputFiles, inputPrefix);
 32        }
 33
 34        /// <summary>
 35        /// Gets the concat input argument.
 36        /// </summary>
 37        /// <param name="inputFiles">The input files.</param>
 38        /// <param name="inputPrefix">The input prefix.</param>
 39        /// <returns>System.String.</returns>
 40        private static string GetConcatInputArgument(IReadOnlyList<string> inputFiles, string inputPrefix)
 41        {
 42            // Get all streams
 43            // If there's more than one we'll need to use the concat command
 044            if (inputFiles.Count > 1)
 45            {
 046                var files = string.Join('|', inputFiles.Select(f => f.EscapeProcessArgument()));
 47
 048                return string.Format(CultureInfo.InvariantCulture, "concat:\"{0}\"", files);
 49            }
 50
 51            // Determine the input path for video files
 052            return GetFileInputArgument(inputFiles[0], inputPrefix);
 53        }
 54
 55        /// <summary>
 56        /// Gets the file input argument.
 57        /// </summary>
 58        /// <param name="path">The path.</param>
 59        /// <param name="inputPrefix">The path prefix.</param>
 60        /// <returns>System.String.</returns>
 61        private static string GetFileInputArgument(string path, string inputPrefix)
 62        {
 063            if (path.Contains("://", StringComparison.Ordinal))
 64            {
 065                return string.Format(CultureInfo.InvariantCulture, "\"{0}\"", path);
 66            }
 67
 068            path = path.EscapeProcessArgument();
 69
 070            return string.Format(CultureInfo.InvariantCulture, "{1}:\"{0}\"", path, inputPrefix);
 71        }
 72    }
 73}