Added the ability to browse different genres (still needs polish).

Fixed a rare bug with crypto.UUID by backfilling it.
This commit is contained in:
Joseph Milazzo 2025-06-06 17:02:42 -05:00
parent d400938610
commit 2e80316057
19 changed files with 288 additions and 33 deletions

View file

@ -4,6 +4,7 @@ using System.Linq;
using System.Text.RegularExpressions;
using API.Data.Misc;
using API.Entities.Enums;
using API.Entities.Metadata;
namespace API.Extensions;
#nullable enable
@ -42,4 +43,16 @@ public static class EnumerableExtensions
return q;
}
public static IEnumerable<SeriesMetadata> RestrictAgainstAgeRestriction(this IEnumerable<SeriesMetadata> items, AgeRestriction restriction)
{
if (restriction.AgeRating == AgeRating.NotApplicable) return items;
var q = items.Where(s => s.AgeRating <= restriction.AgeRating);
if (!restriction.IncludeUnknowns)
{
return q.Where(s => s.AgeRating != AgeRating.Unknown);
}
return q;
}
}