Fixed a bug where the age restriction logic for a person detail page wasn't allowing the person to show if the user had access to SOME of their works.
This commit is contained in:
parent
634b165318
commit
4f13ae0f0b
1 changed files with 4 additions and 2 deletions
|
|
@ -105,8 +105,10 @@ public static class RestrictByAgeExtensions
|
||||||
sm.SeriesMetadata.AgeRating <= restriction.AgeRating));
|
sm.SeriesMetadata.AgeRating <= restriction.AgeRating));
|
||||||
}
|
}
|
||||||
|
|
||||||
return queryable.Where(c => c.SeriesMetadataPeople.All(sm =>
|
return queryable.Where(c =>
|
||||||
sm.SeriesMetadata.AgeRating <= restriction.AgeRating && sm.SeriesMetadata.AgeRating > AgeRating.Unknown));
|
c.SeriesMetadataPeople.Any(sm => sm.SeriesMetadata.AgeRating <= restriction.AgeRating && sm.SeriesMetadata.AgeRating != AgeRating.Unknown) &&
|
||||||
|
c.ChapterPeople.Any(cp => cp.Chapter.AgeRating <= restriction.AgeRating && cp.Chapter.AgeRating != AgeRating.Unknown)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IQueryable<ReadingList> RestrictAgainstAgeRestriction(this IQueryable<ReadingList> queryable, AgeRestriction restriction)
|
public static IQueryable<ReadingList> RestrictAgainstAgeRestriction(this IQueryable<ReadingList> queryable, AgeRestriction restriction)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue