mirror of https://github.com/jellyfin/jellyfin.git
Fix some warnings
This commit is contained in:
parent
2ee3e9e00f
commit
79642af3b8
|
@ -10,9 +10,9 @@ using System.Linq;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Jellyfin.Extensions.Json;
|
||||||
using MediaBrowser.Common.Configuration;
|
using MediaBrowser.Common.Configuration;
|
||||||
using MediaBrowser.Common.Extensions;
|
using MediaBrowser.Common.Extensions;
|
||||||
using Jellyfin.Extensions.Json;
|
|
||||||
using MediaBrowser.Controller.MediaEncoding;
|
using MediaBrowser.Controller.MediaEncoding;
|
||||||
using MediaBrowser.Model.Dlna;
|
using MediaBrowser.Model.Dlna;
|
||||||
using MediaBrowser.Model.Dto;
|
using MediaBrowser.Model.Dto;
|
||||||
|
|
|
@ -23,10 +23,6 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
|
||||||
{
|
{
|
||||||
public abstract class BaseTunerHost
|
public abstract class BaseTunerHost
|
||||||
{
|
{
|
||||||
protected readonly IServerConfigurationManager Config;
|
|
||||||
protected readonly ILogger<BaseTunerHost> Logger;
|
|
||||||
protected readonly IFileSystem FileSystem;
|
|
||||||
|
|
||||||
private readonly IMemoryCache _memoryCache;
|
private readonly IMemoryCache _memoryCache;
|
||||||
|
|
||||||
protected BaseTunerHost(IServerConfigurationManager config, ILogger<BaseTunerHost> logger, IFileSystem fileSystem, IMemoryCache memoryCache)
|
protected BaseTunerHost(IServerConfigurationManager config, ILogger<BaseTunerHost> logger, IFileSystem fileSystem, IMemoryCache memoryCache)
|
||||||
|
@ -37,12 +33,20 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
|
||||||
FileSystem = fileSystem;
|
FileSystem = fileSystem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected IServerConfigurationManager Config { get; }
|
||||||
|
|
||||||
|
protected ILogger<BaseTunerHost> Logger { get; }
|
||||||
|
|
||||||
|
protected IFileSystem FileSystem { get; }
|
||||||
|
|
||||||
public virtual bool IsSupported => true;
|
public virtual bool IsSupported => true;
|
||||||
|
|
||||||
protected abstract Task<List<ChannelInfo>> GetChannelsInternal(TunerHostInfo tuner, CancellationToken cancellationToken);
|
|
||||||
|
|
||||||
public abstract string Type { get; }
|
public abstract string Type { get; }
|
||||||
|
|
||||||
|
protected virtual string ChannelIdPrefix => Type + "_";
|
||||||
|
|
||||||
|
protected abstract Task<List<ChannelInfo>> GetChannelsInternal(TunerHostInfo tuner, CancellationToken cancellationToken);
|
||||||
|
|
||||||
public async Task<List<ChannelInfo>> GetChannels(TunerHostInfo tuner, bool enableCache, CancellationToken cancellationToken)
|
public async Task<List<ChannelInfo>> GetChannels(TunerHostInfo tuner, bool enableCache, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var key = tuner.Id;
|
var key = tuner.Id;
|
||||||
|
@ -217,8 +221,6 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
|
||||||
throw new LiveTvConflictException();
|
throw new LiveTvConflictException();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual string ChannelIdPrefix => Type + "_";
|
|
||||||
|
|
||||||
protected virtual bool IsValidChannelId(string channelId)
|
protected virtual bool IsValidChannelId(string channelId)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(channelId))
|
if (string.IsNullOrEmpty(channelId))
|
||||||
|
|
|
@ -101,7 +101,8 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (localAddress.IsIPv4MappedToIPv6) {
|
if (localAddress.IsIPv4MappedToIPv6)
|
||||||
|
{
|
||||||
localAddress = localAddress.MapToIPv4();
|
localAddress = localAddress.MapToIPv4();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,14 +20,6 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
|
||||||
{
|
{
|
||||||
private readonly IConfigurationManager _configurationManager;
|
private readonly IConfigurationManager _configurationManager;
|
||||||
|
|
||||||
protected readonly IFileSystem FileSystem;
|
|
||||||
|
|
||||||
protected readonly IStreamHelper StreamHelper;
|
|
||||||
|
|
||||||
protected string TempFilePath;
|
|
||||||
protected readonly ILogger Logger;
|
|
||||||
protected readonly CancellationTokenSource LiveStreamCancellationTokenSource = new CancellationTokenSource();
|
|
||||||
|
|
||||||
public LiveStream(
|
public LiveStream(
|
||||||
MediaSourceInfo mediaSource,
|
MediaSourceInfo mediaSource,
|
||||||
TunerHostInfo tuner,
|
TunerHostInfo tuner,
|
||||||
|
@ -55,7 +47,15 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
|
||||||
SetTempFilePath("ts");
|
SetTempFilePath("ts");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual int EmptyReadLimit => 1000;
|
protected IFileSystem FileSystem { get; }
|
||||||
|
|
||||||
|
protected IStreamHelper StreamHelper { get; }
|
||||||
|
|
||||||
|
protected ILogger Logger { get; }
|
||||||
|
|
||||||
|
protected CancellationTokenSource LiveStreamCancellationTokenSource { get; } = new CancellationTokenSource();
|
||||||
|
|
||||||
|
protected string TempFilePath { get; set; }
|
||||||
|
|
||||||
public MediaSourceInfo OriginalMediaSource { get; set; }
|
public MediaSourceInfo OriginalMediaSource { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,15 @@ namespace Emby.Server.Implementations.Playlists
|
||||||
Name = "Playlists";
|
Name = "Playlists";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public override bool IsHidden => true;
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public override bool SupportsInheritedParentImages => false;
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public override string CollectionType => MediaBrowser.Model.Entities.CollectionType.Playlists;
|
||||||
|
|
||||||
public override bool IsVisible(User user)
|
public override bool IsVisible(User user)
|
||||||
{
|
{
|
||||||
return base.IsVisible(user) && GetChildren(user, true).Any();
|
return base.IsVisible(user) && GetChildren(user, true).Any();
|
||||||
|
@ -27,15 +36,6 @@ namespace Emby.Server.Implementations.Playlists
|
||||||
return base.GetEligibleChildrenForRecursiveChildren(user).OfType<Playlist>();
|
return base.GetEligibleChildrenForRecursiveChildren(user).OfType<Playlist>();
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public override bool IsHidden => true;
|
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public override bool SupportsInheritedParentImages => false;
|
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
public override string CollectionType => MediaBrowser.Model.Entities.CollectionType.Playlists;
|
|
||||||
|
|
||||||
protected override QueryResult<BaseItem> GetItemsInternal(InternalItemsQuery query)
|
protected override QueryResult<BaseItem> GetItemsInternal(InternalItemsQuery query)
|
||||||
{
|
{
|
||||||
if (query.User == null)
|
if (query.User == null)
|
||||||
|
|
|
@ -8,10 +8,10 @@ using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using MediaBrowser.Common;
|
|
||||||
using MediaBrowser.Common.Extensions;
|
|
||||||
using Jellyfin.Extensions.Json;
|
using Jellyfin.Extensions.Json;
|
||||||
using Jellyfin.Extensions.Json.Converters;
|
using Jellyfin.Extensions.Json.Converters;
|
||||||
|
using MediaBrowser.Common;
|
||||||
|
using MediaBrowser.Common.Extensions;
|
||||||
using MediaBrowser.Common.Net;
|
using MediaBrowser.Common.Net;
|
||||||
using MediaBrowser.Common.Plugins;
|
using MediaBrowser.Common.Plugins;
|
||||||
using MediaBrowser.Model.Configuration;
|
using MediaBrowser.Model.Configuration;
|
||||||
|
@ -39,14 +39,6 @@ namespace Emby.Server.Implementations.Plugins
|
||||||
|
|
||||||
private IHttpClientFactory? _httpClientFactory;
|
private IHttpClientFactory? _httpClientFactory;
|
||||||
|
|
||||||
private IHttpClientFactory HttpClientFactory
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return _httpClientFactory ?? (_httpClientFactory = _appHost.Resolve<IHttpClientFactory>());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="PluginManager"/> class.
|
/// Initializes a new instance of the <see cref="PluginManager"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -86,6 +78,14 @@ namespace Emby.Server.Implementations.Plugins
|
||||||
_plugins = Directory.Exists(_pluginsPath) ? DiscoverPlugins().ToList() : new List<LocalPlugin>();
|
_plugins = Directory.Exists(_pluginsPath) ? DiscoverPlugins().ToList() : new List<LocalPlugin>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private IHttpClientFactory HttpClientFactory
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _httpClientFactory ??= _appHost.Resolve<IHttpClientFactory>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the Plugins.
|
/// Gets the Plugins.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue