< Summary - Jellyfin

Information
Class: Jellyfin.LiveTv.TunerHosts.HdHomerun.LegacyHdHomerunChannelCommands
Assembly: Jellyfin.LiveTv
File(s): /srv/git/jellyfin/src/Jellyfin.LiveTv/TunerHosts/HdHomerun/LegacyHdHomerunChannelCommands.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 5
Coverable lines: 5
Total lines: 40
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
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(...)0%620%

File(s)

/srv/git/jellyfin/src/Jellyfin.LiveTv/TunerHosts/HdHomerun/LegacyHdHomerunChannelCommands.cs

#LineLine coverage
 1#pragma warning disable CS1591
 2
 3using System.Collections.Generic;
 4using System.Text.RegularExpressions;
 5
 6namespace Jellyfin.LiveTv.TunerHosts.HdHomerun
 7{
 8    public partial class LegacyHdHomerunChannelCommands : IHdHomerunChannelCommands
 9    {
 10        private string? _channel;
 11        private string? _program;
 12
 13        public LegacyHdHomerunChannelCommands(string url)
 14        {
 15            // parse url for channel and program
 016            var match = ChannelAndProgramRegex().Match(url);
 017            if (match.Success)
 18            {
 019                _channel = match.Groups[1].Value;
 020                _program = match.Groups[2].Value;
 21            }
 022        }
 23
 24        [GeneratedRegex(@"\/ch([0-9]+)-?([0-9]*)")]
 25        private static partial Regex ChannelAndProgramRegex();
 26
 27        public IEnumerable<(string CommandName, string CommandValue)> GetCommands()
 28        {
 29            if (!string.IsNullOrEmpty(_channel))
 30            {
 31                yield return ("channel", _channel);
 32            }
 33
 34            if (!string.IsNullOrEmpty(_program))
 35            {
 36                yield return ("program", _program);
 37            }
 38        }
 39    }
 40}

Methods/Properties

.ctor(System.String)