Inherit custom rating
This commit is contained in:
parent
ca0583bcbe
commit
38d88aed58
|
@ -447,9 +447,23 @@ namespace MediaBrowser.Controller.Entities
|
|||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public virtual string CustomRatingForComparison
|
||||
public string CustomRatingForComparison
|
||||
{
|
||||
get { return CustomRating; }
|
||||
get
|
||||
{
|
||||
if (!string.IsNullOrEmpty(CustomRating))
|
||||
{
|
||||
return CustomRating;
|
||||
}
|
||||
|
||||
var parent = Parent;
|
||||
if (parent != null)
|
||||
{
|
||||
return parent.CustomRatingForComparison;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Common.Progress;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Controller.IO;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Localization;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Controller.Resolvers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MoreLinq;
|
||||
using System;
|
||||
|
|
|
@ -98,9 +98,11 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||
/// <returns>System.String.</returns>
|
||||
public override string GetUserDataKey()
|
||||
{
|
||||
if (Series != null && ParentIndexNumber.HasValue && IndexNumber.HasValue)
|
||||
var series = Series;
|
||||
|
||||
if (series != null && ParentIndexNumber.HasValue && IndexNumber.HasValue)
|
||||
{
|
||||
return Series.GetUserDataKey() + ParentIndexNumber.Value.ToString("000") + IndexNumber.Value.ToString("000");
|
||||
return series.GetUserDataKey() + ParentIndexNumber.Value.ToString("000") + IndexNumber.Value.ToString("000");
|
||||
}
|
||||
|
||||
return base.GetUserDataKey();
|
||||
|
@ -112,16 +114,11 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||
[IgnoreDataMember]
|
||||
public override string OfficialRatingForComparison
|
||||
{
|
||||
get { return Series != null ? Series.OfficialRatingForComparison : base.OfficialRatingForComparison; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Our rating comes from our series
|
||||
/// </summary>
|
||||
[IgnoreDataMember]
|
||||
public override string CustomRatingForComparison
|
||||
{
|
||||
get { return Series != null ? Series.CustomRatingForComparison : base.CustomRatingForComparison; }
|
||||
get
|
||||
{
|
||||
var series = Series;
|
||||
return series != null ? series.OfficialRatingForComparison : base.OfficialRatingForComparison;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -119,16 +119,11 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||
[IgnoreDataMember]
|
||||
public override string OfficialRatingForComparison
|
||||
{
|
||||
get { return Series != null ? Series.OfficialRatingForComparison : base.OfficialRatingForComparison; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Our rating comes from our series
|
||||
/// </summary>
|
||||
[IgnoreDataMember]
|
||||
public override string CustomRatingForComparison
|
||||
{
|
||||
get { return Series != null ? Series.CustomRatingForComparison : base.CustomRatingForComparison; }
|
||||
get
|
||||
{
|
||||
var series = Series;
|
||||
return series != null ? series.OfficialRatingForComparison : base.OfficialRatingForComparison;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -61,8 +61,9 @@ namespace MediaBrowser.Providers.TV
|
|||
public Task<IEnumerable<RemoteImageInfo>> GetAllImages(IHasImages item, CancellationToken cancellationToken)
|
||||
{
|
||||
var episode = (Episode)item;
|
||||
var series = episode.Series;
|
||||
|
||||
var seriesId = episode.Series != null ? episode.Series.GetProviderId(MetadataProviders.Tvdb) : null;
|
||||
var seriesId = series != null ? series.GetProviderId(MetadataProviders.Tvdb) : null;
|
||||
|
||||
if (!string.IsNullOrEmpty(seriesId))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user