mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-07-09 03:04:19 -04:00
In Progress Activity Stream Fixes (#136)
* Fixed a bug in In-Progress where it wasn't properly fetching series.
This commit is contained in:
parent
667d1d2a4d
commit
ca5c666b7b
@ -302,7 +302,8 @@ namespace API.Data
|
||||
/// <returns></returns>
|
||||
public async Task<IEnumerable<SeriesDto>> GetInProgress(int userId, int libraryId, int limit)
|
||||
{
|
||||
var series = await _context.Series
|
||||
|
||||
var seriesWithProgress = _context.Series
|
||||
.Join(_context.AppUserProgresses, s => s.Id, progress => progress.SeriesId, (s, progress) => new
|
||||
{
|
||||
Series = s,
|
||||
@ -313,10 +314,14 @@ namespace API.Data
|
||||
.Where(s => s.AppUserId == userId
|
||||
&& s.PagesRead > 0
|
||||
&& s.PagesRead < s.Series.Pages
|
||||
&& (libraryId <= 0 || s.Series.LibraryId == libraryId) )
|
||||
.Take(limit)
|
||||
&& (libraryId <= 0 || s.Series.LibraryId == libraryId))
|
||||
.Select(s => s.Series.Id);
|
||||
|
||||
|
||||
var series = await _context.Series
|
||||
.Where(s => seriesWithProgress.Contains(s.Id))
|
||||
.OrderByDescending(s => s.LastModified)
|
||||
.Select(s => s.Series)
|
||||
.Take(limit)
|
||||
.ProjectTo<SeriesDto>(_mapper.ConfigurationProvider)
|
||||
.AsNoTracking()
|
||||
.ToListAsync();
|
||||
|
Loading…
x
Reference in New Issue
Block a user