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

View File

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

View File

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