More warn

This commit is contained in:
Bond_009 2020-08-19 18:02:34 +02:00
parent e77a45adcf
commit 68edccd9f4
4 changed files with 22 additions and 15 deletions

View File

@ -37,6 +37,8 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
private readonly INetworkManager _networkManager;
private readonly IStreamHelper _streamHelper;
private readonly Dictionary<string, DiscoverResponse> _modelCache = new Dictionary<string, DiscoverResponse>();
public HdHomerunHost(
IServerConfigurationManager config,
ILogger<HdHomerunHost> logger,
@ -114,7 +116,6 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
}).Cast<ChannelInfo>().ToList();
}
private readonly Dictionary<string, DiscoverResponse> _modelCache = new Dictionary<string, DiscoverResponse>();
private async Task<DiscoverResponse> GetModelInfo(TunerHostInfo info, bool throwAllExceptions, CancellationToken cancellationToken)
{
var cacheKey = info.Id;

View File

@ -1,4 +1,7 @@
#pragma warning disable CS1591
using System;
using System.Collections.Generic;
namespace MediaBrowser.Controller.Entities
{
@ -8,6 +11,6 @@ namespace MediaBrowser.Controller.Entities
/// Gets or sets the special feature ids.
/// </summary>
/// <value>The special feature ids.</value>
Guid[] SpecialFeatureIds { get; set; }
IReadOnlyList<Guid> SpecialFeatureIds { get; set; }
}
}

View File

@ -1,3 +1,4 @@
#pragma warning disable CS1591
using System;
using System.Collections.Generic;
@ -19,8 +20,6 @@ namespace MediaBrowser.Controller.Entities.Movies
/// </summary>
public class Movie : Video, IHasSpecialFeatures, IHasTrailers, IHasLookupInfo<MovieInfo>, ISupportsBoxSetGrouping
{
public Guid[] SpecialFeatureIds { get; set; }
public Movie()
{
SpecialFeatureIds = Array.Empty<Guid>();
@ -29,6 +28,9 @@ namespace MediaBrowser.Controller.Entities.Movies
RemoteTrailerIds = Array.Empty<Guid>();
}
/// <inheritdoc />
public IReadOnlyList<Guid> SpecialFeatureIds { get; set; }
/// <inheritdoc />
public IReadOnlyList<Guid> LocalTrailerIds { get; set; }
@ -48,6 +50,9 @@ namespace MediaBrowser.Controller.Entities.Movies
set => TmdbCollectionName = value;
}
[JsonIgnore]
public override bool StopRefreshIfLocalMetadataFound => false;
public override double GetDefaultPrimaryImageAspectRatio()
{
// hack for tv plugins
@ -107,6 +112,7 @@ namespace MediaBrowser.Controller.Entities.Movies
return itemsChanged;
}
/// <inheritdoc />
public override UnratedItem GetBlockUnratedType()
{
return UnratedItem.Movie;
@ -135,6 +141,7 @@ namespace MediaBrowser.Controller.Entities.Movies
return info;
}
/// <inheritdoc />
public override bool BeforeMetadataRefresh(bool replaceAllMetdata)
{
var hasChanges = base.BeforeMetadataRefresh(replaceAllMetdata);
@ -171,6 +178,7 @@ namespace MediaBrowser.Controller.Entities.Movies
return hasChanges;
}
/// <inheritdoc />
public override List<ExternalUrl> GetRelatedUrls()
{
var list = base.GetRelatedUrls();
@ -187,8 +195,5 @@ namespace MediaBrowser.Controller.Entities.Movies
return list;
}
[JsonIgnore]
public override bool StopRefreshIfLocalMetadataFound => false;
}
}

View File

@ -1,3 +1,5 @@
#pragma warning disable CS1591
using System;
using System.Collections.Generic;
using System.Globalization;
@ -672,9 +674,7 @@ namespace MediaBrowser.Controller.Entities
var isPlaceHolder = false;
var hasPlaceHolder = item as ISupportsPlaceHolders;
if (hasPlaceHolder != null)
if (item is ISupportsPlaceHolders hasPlaceHolder)
{
isPlaceHolder = hasPlaceHolder.IsPlaceHolder;
}
@ -689,13 +689,11 @@ namespace MediaBrowser.Controller.Entities
{
var filterValue = query.HasSpecialFeature.Value;
var movie = item as IHasSpecialFeatures;
if (movie != null)
if (item is IHasSpecialFeatures movie)
{
var ok = filterValue
? movie.SpecialFeatureIds.Length > 0
: movie.SpecialFeatureIds.Length == 0;
? movie.SpecialFeatureIds.Count > 0
: movie.SpecialFeatureIds.Count == 0;
if (!ok)
{