Skip to content

Kavita is a fast, feature rich, cross platform reading server. Built with the goal of being a full solution for all your reading needs. Setup your own server and share your reading collection with your friends and family.

Fixed the In progress API returning back series that didn't belong (#453)

Joseph Milazzo2f8af9f8e69a
diff --git a/.github/workflows/nightly-docker.yml b/.github/workflows/nightly-docker.yml
index 680015afe..9df2375cb 100644
--- a/.github/workflows/nightly-docker.yml
+++ b/.github/workflows/nightly-docker.yml
@@ -28,7 +28,7 @@ jobs:
echo 'Copying back to Kavita wwwroot'
rsync -a dist/ ../../API/wwwroot/
-
+
cd ../ || exit
- name: Get csproj Version
@@ -38,14 +38,14 @@ jobs:
proj-path: Kavita.Common/Kavita.Common.csproj
- name: Echo csproj version
- run: echo "${{steps.get-version.outputs.assembly-version}}"
+ run: echo "${{steps.get-version.outputs.assembly-version}}"
- name: Compile dotnet app
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x'
- run: ./monorepo-build.sh
-
+
- name: Trigger Sentry workflow
uses: benc-uk/workflow-dispatch@v1
with:
@@ -77,12 +77,12 @@ jobs:
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
-
+
- name: Notify Discord
uses: rjstone/discord-webhook-notify@v1
with:
severity: info
- description:
+ description: ${{ github.event.body }}
details: 'https://hub.docker.com/r/kizaing/kavita/tags?page=1&ordering=last_updated'
text: A new nightly build has been released for docker.
webhookUrl: ${{ secrets.DISCORD_DOCKER_UPDATE_URL }}
diff --git a/API/Data/SeriesRepository.cs b/API/Data/SeriesRepository.cs
index 7a608882a..92d19042b 100644
--- a/API/Data/SeriesRepository.cs
+++ b/API/Data/SeriesRepository.cs
@@ -370,32 +370,23 @@ namespace API.Data
.Join(_context.AppUserProgresses, s => s.Id, progress => progress.SeriesId, (s, progress) => new
{
Series = s,
- PagesRead = _context.AppUserProgresses.Where(s1 => s1.SeriesId == s.Id).Sum(s1 => s1.PagesRead),
+ PagesRead = _context.AppUserProgresses.Where(s1 => s1.SeriesId == s.Id && s1.AppUserId == userId).Sum(s1 => s1.PagesRead),
progress.AppUserId,
- LastModified = _context.AppUserProgresses.Where(p => p.Id == progress.Id).Max(p => p.LastModified)
+ LastModified = _context.AppUserProgresses.Where(p => p.Id == progress.Id && p.AppUserId == userId).Max(p => p.LastModified)
})
.AsNoTracking();
-
-
var retSeries = series.Where(s => s.AppUserId == userId
&& s.PagesRead > 0
- && s.PagesRead < s.Series.Pages
- /*&& userLibraries.Contains(s.Series.LibraryId)*/
- /* && formats.Contains(s.Series.Format) */)
+ && s.PagesRead < s.Series.Pages)
.OrderByDescending(s => s.LastModified)
.Select(s => s.Series)
.ProjectTo<SeriesDto>(_mapper.ConfigurationProvider)
+ .AsSplitQuery()
.AsNoTracking();
- // var retSeries = series
- // .OrderByDescending(s => s.LastModified)
- // .Select(s => s.Series)
- // .ProjectTo<SeriesDto>(_mapper.ConfigurationProvider)
- // .AsNoTracking();
- // BUG: Pagination does not work for this query as when we pull the data back, we get multiple rows of the same series
+ // Pagination does not work for this query as when we pull the data back, we get multiple rows of the same series. See controller for pagination code
return await retSeries.ToListAsync();
- //return await PagedList<SeriesDto>.CreateAsync(retSeries, userParams.PageNumber, userParams.PageSize);
}
public async Task<SeriesMetadataDto> GetSeriesMetadata(int seriesId)
diff --git a/Kavita.Common/Kavita.Common.csproj b/Kavita.Common/Kavita.Common.csproj
index d099ff6ea..fbba64189 100644
--- a/Kavita.Common/Kavita.Common.csproj
+++ b/Kavita.Common/Kavita.Common.csproj
@@ -4,7 +4,7 @@
<TargetFramework>net5.0</TargetFramework>
<Company>kavitareader.com</Company>
<Product>Kavita</Product>
- <AssemblyVersion>0.4.3.7</AssemblyVersion>
+ <AssemblyVersion>0.4.3.8</AssemblyVersion>
<NeutralLanguage>en</NeutralLanguage>
</PropertyGroup>