< Summary - Jellyfin

Information
Class: MediaBrowser.Model.Dlna.SubtitleProfile
Assembly: MediaBrowser.Model
File(s): /srv/git/jellyfin/MediaBrowser.Model/Dlna/SubtitleProfile.cs
Line coverage
40%
Covered lines: 2
Uncovered lines: 3
Coverable lines: 5
Total lines: 62
Line coverage: 40%
Branch coverage
25%
Covered branches: 1
Total branches: 4
Branch coverage: 25%
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
SupportsLanguage(...)25%7.46440%

File(s)

/srv/git/jellyfin/MediaBrowser.Model/Dlna/SubtitleProfile.cs

#LineLine coverage
 1#nullable disable
 2
 3using System.Xml.Serialization;
 4using MediaBrowser.Model.Extensions;
 5
 6namespace MediaBrowser.Model.Dlna;
 7
 8/// <summary>
 9/// A class for subtitle profile information.
 10/// </summary>
 11public class SubtitleProfile
 12{
 13    /// <summary>
 14    /// Gets or sets the format.
 15    /// </summary>
 16    [XmlAttribute("format")]
 17    public string Format { get; set; }
 18
 19    /// <summary>
 20    /// Gets or sets the delivery method.
 21    /// </summary>
 22    [XmlAttribute("method")]
 23    public SubtitleDeliveryMethod Method { get; set; }
 24
 25    /// <summary>
 26    /// Gets or sets the DIDL mode.
 27    /// </summary>
 28    [XmlAttribute("didlMode")]
 29    public string DidlMode { get; set; }
 30
 31    /// <summary>
 32    /// Gets or sets the language.
 33    /// </summary>
 34    [XmlAttribute("language")]
 35    public string Language { get; set; }
 36
 37    /// <summary>
 38    /// Gets or sets the container.
 39    /// </summary>
 40    [XmlAttribute("container")]
 41    public string Container { get; set; }
 42
 43    /// <summary>
 44    /// Checks if a language is supported.
 45    /// </summary>
 46    /// <param name="subLanguage">The language to check for support.</param>
 47    /// <returns><c>true</c> if supported.</returns>
 48    public bool SupportsLanguage(string subLanguage)
 49    {
 133450        if (string.IsNullOrEmpty(Language))
 51        {
 133452            return true;
 53        }
 54
 055        if (string.IsNullOrEmpty(subLanguage))
 56        {
 057            subLanguage = "und";
 58        }
 59
 060        return ContainerHelper.ContainsContainer(Language, subLanguage);
 61    }
 62}

Methods/Properties

SupportsLanguage(System.String)