Various bug fixes (#3667)

This commit is contained in:
Fesaa 2025-03-23 21:10:50 +01:00 committed by GitHub
parent a1d3aef39b
commit 1ad8a360cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 73 additions and 32 deletions

View file

@ -351,8 +351,10 @@ public class ReadingListRepository : IReadingListRepository
public async Task<ReadingListDto?> GetReadingListDtoByIdAsync(int readingListId, int userId)
{
var user = await _context.AppUser.FirstAsync(u => u.Id == userId);
return await _context.ReadingList
.Where(r => r.Id == readingListId && (r.AppUserId == userId || r.Promoted))
.RestrictAgainstAgeRestriction(user.GetAgeRestriction())
.ProjectTo<ReadingListDto>(_mapper.ConfigurationProvider)
.SingleOrDefaultAsync();
}