diff options
Diffstat (limited to 'Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs')
| -rw-r--r-- | Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs index ef2010ba64..ee86f66e69 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs @@ -1,8 +1,3 @@ -using MediaBrowser.Common.Configuration; -using MediaBrowser.Controller.LiveTv; -using MediaBrowser.Model.Dto; -using MediaBrowser.Model.LiveTv; -using Microsoft.Extensions.Logging; using System; using System.Collections.Concurrent; using System.Collections.Generic; @@ -10,13 +5,16 @@ using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; -using MediaBrowser.Common.Extensions; +using MediaBrowser.Common.Configuration; using MediaBrowser.Controller.Configuration; +using MediaBrowser.Controller.Library; +using MediaBrowser.Controller.LiveTv; using MediaBrowser.Controller.MediaEncoding; -using MediaBrowser.Model.Dlna; +using MediaBrowser.Model.Dto; using MediaBrowser.Model.IO; +using MediaBrowser.Model.LiveTv; using MediaBrowser.Model.Serialization; -using MediaBrowser.Controller.Library; +using Microsoft.Extensions.Logging; namespace Emby.Server.Implementations.LiveTv.TunerHosts { @@ -40,13 +38,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts FileSystem = fileSystem; } - public virtual bool IsSupported - { - get - { - return true; - } - } + public virtual bool IsSupported => true; protected abstract Task<List<ChannelInfo>> GetChannelsInternal(TunerHostInfo tuner, CancellationToken cancellationToken); public abstract string Type { get; } @@ -140,7 +132,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts { if (string.IsNullOrEmpty(channelId)) { - throw new ArgumentNullException("channelId"); + throw new ArgumentNullException(nameof(channelId)); } if (IsValidChannelId(channelId)) @@ -175,7 +167,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts { if (string.IsNullOrEmpty(channelId)) { - throw new ArgumentNullException("channelId"); + throw new ArgumentNullException(nameof(channelId)); } if (!IsValidChannelId(channelId)) @@ -228,18 +220,13 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts throw new LiveTvConflictException(); } - protected virtual string ChannelIdPrefix - { - get - { - return Type + "_"; - } - } + protected virtual string ChannelIdPrefix => Type + "_"; + protected virtual bool IsValidChannelId(string channelId) { if (string.IsNullOrEmpty(channelId)) { - throw new ArgumentNullException("channelId"); + throw new ArgumentNullException(nameof(channelId)); } return channelId.StartsWith(ChannelIdPrefix, StringComparison.OrdinalIgnoreCase); |
