< Summary - Jellyfin

Information
Class: Emby.Naming.Video.VideoFileInfo
Assembly: Emby.Naming
File(s): /srv/git/jellyfin/Emby.Naming/Video/VideoFileInfo.cs
Line coverage
100%
Covered lines: 16
Uncovered lines: 0
Coverable lines: 16
Total lines: 120
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
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_FileNameWithoutExtension()100%22100%
ToString()100%11100%

File(s)

/srv/git/jellyfin/Emby.Naming/Video/VideoFileInfo.cs

#LineLine coverage
 1using System;
 2using MediaBrowser.Model.Entities;
 3
 4namespace Emby.Naming.Video
 5{
 6    /// <summary>
 7    /// Represents a single video file.
 8    /// </summary>
 9    public class VideoFileInfo
 10    {
 11        /// <summary>
 12        /// Initializes a new instance of the <see cref="VideoFileInfo"/> class.
 13        /// </summary>
 14        /// <param name="name">Name of file.</param>
 15        /// <param name="path">Path to the file.</param>
 16        /// <param name="container">Container type.</param>
 17        /// <param name="year">Year of release.</param>
 18        /// <param name="extraType">Extra type.</param>
 19        /// <param name="extraRule">Extra rule.</param>
 20        /// <param name="format3D">Format 3D.</param>
 21        /// <param name="is3D">Is 3D.</param>
 22        /// <param name="isStub">Is Stub.</param>
 23        /// <param name="stubType">Stub type.</param>
 24        /// <param name="isDirectory">Is directory.</param>
 25        public VideoFileInfo(string name, string path, string? container, int? year = default, ExtraType? extraType = de
 26        {
 25127            Path = path;
 25128            Container = container;
 25129            Name = name;
 25130            Year = year;
 25131            ExtraType = extraType;
 25132            ExtraRule = extraRule;
 25133            Format3D = format3D;
 25134            Is3D = is3D;
 25135            IsStub = isStub;
 25136            StubType = stubType;
 25137            IsDirectory = isDirectory;
 25138        }
 39
 40        /// <summary>
 41        /// Gets or sets the path.
 42        /// </summary>
 43        /// <value>The path.</value>
 44        public string Path { get; set; }
 45
 46        /// <summary>
 47        /// Gets or sets the container.
 48        /// </summary>
 49        /// <value>The container.</value>
 50        public string? Container { get; set; }
 51
 52        /// <summary>
 53        /// Gets or sets the name.
 54        /// </summary>
 55        /// <value>The name.</value>
 56        public string Name { get; set; }
 57
 58        /// <summary>
 59        /// Gets or sets the year.
 60        /// </summary>
 61        /// <value>The year.</value>
 62        public int? Year { get; set; }
 63
 64        /// <summary>
 65        /// Gets or sets the type of the extra, e.g. trailer, theme song, behind the scenes, etc.
 66        /// </summary>
 67        /// <value>The type of the extra.</value>
 68        public ExtraType? ExtraType { get; set; }
 69
 70        /// <summary>
 71        /// Gets or sets the extra rule.
 72        /// </summary>
 73        /// <value>The extra rule.</value>
 74        public ExtraRule? ExtraRule { get; set; }
 75
 76        /// <summary>
 77        /// Gets or sets the format3 d.
 78        /// </summary>
 79        /// <value>The format3 d.</value>
 80        public string? Format3D { get; set; }
 81
 82        /// <summary>
 83        /// Gets or sets a value indicating whether [is3 d].
 84        /// </summary>
 85        /// <value><c>true</c> if [is3 d]; otherwise, <c>false</c>.</value>
 86        public bool Is3D { get; set; }
 87
 88        /// <summary>
 89        /// Gets or sets a value indicating whether this instance is stub.
 90        /// </summary>
 91        /// <value><c>true</c> if this instance is stub; otherwise, <c>false</c>.</value>
 92        public bool IsStub { get; set; }
 93
 94        /// <summary>
 95        /// Gets or sets the type of the stub.
 96        /// </summary>
 97        /// <value>The type of the stub.</value>
 98        public string? StubType { get; set; }
 99
 100        /// <summary>
 101        /// Gets or sets a value indicating whether this instance is a directory.
 102        /// </summary>
 103        /// <value>The type.</value>
 104        public bool IsDirectory { get; set; }
 105
 106        /// <summary>
 107        /// Gets the file name without extension.
 108        /// </summary>
 109        /// <value>The file name without extension.</value>
 302110        public ReadOnlySpan<char> FileNameWithoutExtension => !IsDirectory
 302111            ? System.IO.Path.GetFileNameWithoutExtension(Path.AsSpan())
 302112            : System.IO.Path.GetFileName(Path.AsSpan());
 113
 114        /// <inheritdoc />
 115        public override string ToString()
 116        {
 48117            return "VideoFileInfo(Name: '" + Name + "')";
 118        }
 119    }
 120}