Fix reading lists not respecting age ratings (#3590)

This commit is contained in:
Fesaa 2025-03-09 18:38:08 +00:00 committed by GitHub
parent 5aa9699a99
commit 1244e4263e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 2 deletions

View file

@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using API.Data.Misc;
using API.Entities;
using API.Helpers;
@ -44,4 +45,13 @@ public static class AppUserExtensions
OrderableHelper.ReorderItems(user.SideNavStreams);
}
public static AgeRestriction GetAgeRestriction(this AppUser user)
{
return new AgeRestriction()
{
AgeRating = user.AgeRestriction,
IncludeUnknowns = user.AgeRestrictionIncludeUnknowns,
};
}
}