On Deck tweaks + Bugfixes (#1141)

* Tweaked the On deck to only look for series that have progress in past 30 days. This number is just to test it out, it will be configurable later. Tweaked the layout of the dashboard to remove a redundant section.

* Fixed a bug where archives with __MACOSX/ inside would break the reader during flattening.

* Fixed a bug where confirm service rejection should have resolved as false.

* Fixed an issue with checking if server is accessible with loopback and local ips
This commit is contained in:
Joseph Milazzo 2022-03-08 17:33:58 -06:00 committed by GitHub
parent 5aa40142c4
commit b921a14e12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 81 additions and 16 deletions

View file

@ -597,7 +597,7 @@ public class SeriesRepository : ISeriesRepository
{
//var allSeriesWithProgress = await _context.AppUserProgresses.Select(p => p.SeriesId).ToListAsync();
//var allChapters = await GetChapterIdsForSeriesAsync(allSeriesWithProgress);
var cuttoffProgressPoint = DateTime.Now - TimeSpan.FromDays(30);
var query = (await CreateFilteredSearchQueryable(userId, libraryId, filter))
.Join(_context.AppUserProgresses, s => s.Id, progress => progress.SeriesId, (s, progress) =>
new
@ -606,12 +606,14 @@ public class SeriesRepository : ISeriesRepository
PagesRead = _context.AppUserProgresses.Where(s1 => s1.SeriesId == s.Id && s1.AppUserId == userId)
.Sum(s1 => s1.PagesRead),
progress.AppUserId,
LastReadingProgress = _context.AppUserProgresses.Where(p => p.Id == progress.Id && p.AppUserId == userId)
LastReadingProgress = _context.AppUserProgresses
.Where(p => p.Id == progress.Id && p.AppUserId == userId)
.Max(p => p.LastModified),
// This is only taking into account chapters that have progress on them, not all chapters in said series
LastChapterCreated = _context.Chapter.Where(c => progress.ChapterId == c.Id).Max(c => c.Created)
//LastChapterCreated = _context.Chapter.Where(c => allChapters.Contains(c.Id)).Max(c => c.Created)
});
})
.Where(d => d.LastReadingProgress >= cuttoffProgressPoint);
// I think I need another Join statement. The problem is the chapters are still limited to progress