Fixed some unit tests (not sure when they broke)

This commit is contained in:
Joseph Milazzo 2025-06-20 13:52:44 -05:00
parent 19be1193a1
commit 0d856d10e3
2 changed files with 8 additions and 2 deletions

View file

@ -67,7 +67,7 @@ public class QueryableExtensionsTests
[Theory]
[InlineData(true, 2)]
[InlineData(false, 1)]
[InlineData(false, 2)]
public void RestrictAgainstAgeRestriction_Genre_ShouldRestrictEverythingAboveTeen(bool includeUnknowns, int expectedCount)
{
var items = new List<Genre>()
@ -94,7 +94,7 @@ public class QueryableExtensionsTests
[Theory]
[InlineData(true, 2)]
[InlineData(false, 1)]
[InlineData(false, 2)]
public void RestrictAgainstAgeRestriction_Tag_ShouldRestrictEverythingAboveTeen(bool includeUnknowns, int expectedCount)
{
var items = new List<Tag>()

View file

@ -56,6 +56,12 @@ public static class RestrictByAgeExtensions
sm.Metadata.AgeRating <= restriction.AgeRating && sm.Metadata.AgeRating > AgeRating.Unknown));
}
/// <summary>
/// Returns all Genres where any of the linked Series/Chapters are less than or equal to restriction age rating
/// </summary>
/// <param name="queryable"></param>
/// <param name="restriction"></param>
/// <returns></returns>
public static IQueryable<Genre> RestrictAgainstAgeRestriction(this IQueryable<Genre> queryable, AgeRestriction restriction)
{
if (restriction.AgeRating == AgeRating.NotApplicable) return queryable;