< Summary - Jellyfin

Information
Class: Jellyfin.LiveTv.Channels.ChannelDynamicMediaSourceProvider
Assembly: Jellyfin.LiveTv
File(s): /srv/git/jellyfin/src/Jellyfin.LiveTv/Channels/ChannelDynamicMediaSourceProvider.cs
Line coverage
33%
Covered lines: 2
Uncovered lines: 4
Coverable lines: 6
Total lines: 43
Line coverage: 33.3%
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(...)100%11100%
GetMediaSources(...)0%620%
OpenMediaSource(...)100%210%

File(s)

/srv/git/jellyfin/src/Jellyfin.LiveTv/Channels/ChannelDynamicMediaSourceProvider.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.Linq;
 4using System.Threading;
 5using System.Threading.Tasks;
 6using MediaBrowser.Controller.Channels;
 7using MediaBrowser.Controller.Entities;
 8using MediaBrowser.Controller.Library;
 9using MediaBrowser.Model.Dto;
 10
 11namespace Jellyfin.LiveTv.Channels
 12{
 13    /// <summary>
 14    /// A media source provider for channels.
 15    /// </summary>
 16    public class ChannelDynamicMediaSourceProvider : IMediaSourceProvider
 17    {
 18        private readonly ChannelManager _channelManager;
 19
 20        /// <summary>
 21        /// Initializes a new instance of the <see cref="ChannelDynamicMediaSourceProvider"/> class.
 22        /// </summary>
 23        /// <param name="channelManager">The channel manager.</param>
 24        public ChannelDynamicMediaSourceProvider(IChannelManager channelManager)
 25        {
 2226            _channelManager = (ChannelManager)channelManager;
 2227        }
 28
 29        /// <inheritdoc />
 30        public Task<IEnumerable<MediaSourceInfo>> GetMediaSources(BaseItem item, CancellationToken cancellationToken)
 31        {
 032            return item.SourceType == SourceType.Channel
 033                ? _channelManager.GetDynamicMediaSources(item, cancellationToken)
 034                : Task.FromResult(Enumerable.Empty<MediaSourceInfo>());
 35        }
 36
 37        /// <inheritdoc />
 38        public Task<ILiveStream> OpenMediaSource(string openToken, List<ILiveStream> currentLiveStreams, CancellationTok
 39        {
 040            throw new NotImplementedException();
 41        }
 42    }
 43}