< Summary - Jellyfin

Information
Class: MediaBrowser.Controller.Library.TVUtils
Assembly: MediaBrowser.Controller
File(s): /srv/git/jellyfin/MediaBrowser.Controller/Library/TVUtils.cs
Line coverage
36%
Covered lines: 7
Uncovered lines: 12
Coverable lines: 19
Total lines: 49
Line coverage: 36.8%
Branch coverage
50%
Covered branches: 3
Total branches: 6
Branch coverage: 50%
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
GetAirDays(...)50%15.07636.84%

File(s)

/srv/git/jellyfin/MediaBrowser.Controller/Library/TVUtils.cs

#LineLine coverage
 1using System;
 2using System.Diagnostics.CodeAnalysis;
 3
 4namespace MediaBrowser.Controller.Library
 5{
 6    /// <summary>
 7    /// Class TVUtils.
 8    /// </summary>
 9    public static class TVUtils
 10    {
 11        /// <summary>
 12        /// Gets the air days.
 13        /// </summary>
 14        /// <param name="day">The day.</param>
 15        /// <returns>List{DayOfWeek}.</returns>
 16        [return: NotNullIfNotNull("day")]
 17        public static DayOfWeek[]? GetAirDays(string? day)
 18        {
 119            if (!string.IsNullOrEmpty(day))
 20            {
 121                if (string.Equals(day, "Daily", StringComparison.OrdinalIgnoreCase))
 22                {
 023                    return new[]
 024                    {
 025                        DayOfWeek.Sunday,
 026                        DayOfWeek.Monday,
 027                        DayOfWeek.Tuesday,
 028                        DayOfWeek.Wednesday,
 029                        DayOfWeek.Thursday,
 030                        DayOfWeek.Friday,
 031                        DayOfWeek.Saturday
 032                    };
 33                }
 34
 135                if (Enum.TryParse(day, true, out DayOfWeek value))
 36                {
 137                    return new[]
 138                    {
 139                        value
 140                    };
 41                }
 42
 043                return Array.Empty<DayOfWeek>();
 44            }
 45
 046            return null;
 47        }
 48    }
 49}

Methods/Properties

GetAirDays(System.String)