Bugfixes + Potential iOS Webtoon Reader Fix (#2650)

This commit is contained in:
Joe Milazzo 2024-01-25 11:09:44 -06:00 committed by GitHub
parent 56fa393cf0
commit f660a1cd06
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 157 additions and 197 deletions

View file

@ -85,9 +85,9 @@ public class ExternalSeriesMetadataRepository : IExternalSeriesMetadataRepositor
{
return _context.ExternalSeriesMetadata
.Where(s => s.SeriesId == seriesId)
.Include(s => s.ExternalReviews.Take(25))
.Include(s => s.ExternalRatings.Take(25))
.Include(s => s.ExternalRecommendations.Take(25))
.Include(s => s.ExternalReviews.Take(limit))
.Include(s => s.ExternalRatings.Take(limit))
.Include(s => s.ExternalRecommendations.Take(limit))
.AsSplitQuery()
.FirstOrDefaultAsync();
}
@ -138,7 +138,13 @@ public class ExternalSeriesMetadataRepository : IExternalSeriesMetadataRepositor
var seriesDetailPlusDto = new SeriesDetailPlusDto()
{
Ratings = seriesDetailDto.ExternalRatings.Select(r => _mapper.Map<RatingDto>(r)),
Reviews = seriesDetailDto.ExternalReviews.OrderByDescending(r => r.Score).Select(r => _mapper.Map<UserReviewDto>(r)),
Reviews = seriesDetailDto.ExternalReviews.OrderByDescending(r => r.Score)
.Select(r =>
{
var ret = _mapper.Map<UserReviewDto>(r);
ret.IsExternal = true;
return ret;
}),
Recommendations = new RecommendationDto()
{
ExternalSeries = externalSeriesRecommendations,

View file

@ -490,6 +490,10 @@ public class SeriesRepository : ISeriesRepository
.ProjectTo<MangaFileDto>(_mapper.ConfigurationProvider)
.ToListAsync();
}
else
{
result.Files = new List<MangaFileDto>();
}
result.Chapters = await _context.Chapter
.Include(c => c.Files)
@ -1930,7 +1934,8 @@ public class SeriesRepository : ISeriesRepository
{
// If there is 0 or 1 rating and that rating is you, return 0 back
var countOfRatingsThatAreUser = await _context.AppUserRating
.Where(r => r.SeriesId == seriesId && r.HasBeenRated).CountAsync(u => u.AppUserId == userId);
.Where(r => r.SeriesId == seriesId && r.HasBeenRated)
.CountAsync(u => u.AppUserId == userId);
if (countOfRatingsThatAreUser == 1)
{
return 0;