mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-07-09 03:04:19 -04:00
Fixed the In progress API returning back series that didn't belong (#453)
* Fixed the In progress API returning back series that had another users progress on them. Added SplitQuery which speeds up query significantly. * Try out putting PR body into notification
This commit is contained in:
parent
1ec8f6235f
commit
2f8af9f8e6
10
.github/workflows/nightly-docker.yml
vendored
10
.github/workflows/nightly-docker.yml
vendored
@ -28,7 +28,7 @@ jobs:
|
|||||||
|
|
||||||
echo 'Copying back to Kavita wwwroot'
|
echo 'Copying back to Kavita wwwroot'
|
||||||
rsync -a dist/ ../../API/wwwroot/
|
rsync -a dist/ ../../API/wwwroot/
|
||||||
|
|
||||||
cd ../ || exit
|
cd ../ || exit
|
||||||
|
|
||||||
- name: Get csproj Version
|
- name: Get csproj Version
|
||||||
@ -38,14 +38,14 @@ jobs:
|
|||||||
proj-path: Kavita.Common/Kavita.Common.csproj
|
proj-path: Kavita.Common/Kavita.Common.csproj
|
||||||
|
|
||||||
- name: Echo csproj version
|
- name: Echo csproj version
|
||||||
run: echo "${{steps.get-version.outputs.assembly-version}}"
|
run: echo "${{steps.get-version.outputs.assembly-version}}"
|
||||||
|
|
||||||
- name: Compile dotnet app
|
- name: Compile dotnet app
|
||||||
uses: actions/setup-dotnet@v1
|
uses: actions/setup-dotnet@v1
|
||||||
with:
|
with:
|
||||||
dotnet-version: '5.0.x'
|
dotnet-version: '5.0.x'
|
||||||
- run: ./monorepo-build.sh
|
- run: ./monorepo-build.sh
|
||||||
|
|
||||||
- name: Trigger Sentry workflow
|
- name: Trigger Sentry workflow
|
||||||
uses: benc-uk/workflow-dispatch@v1
|
uses: benc-uk/workflow-dispatch@v1
|
||||||
with:
|
with:
|
||||||
@ -77,12 +77,12 @@ jobs:
|
|||||||
|
|
||||||
- name: Image digest
|
- name: Image digest
|
||||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||||
|
|
||||||
- name: Notify Discord
|
- name: Notify Discord
|
||||||
uses: rjstone/discord-webhook-notify@v1
|
uses: rjstone/discord-webhook-notify@v1
|
||||||
with:
|
with:
|
||||||
severity: info
|
severity: info
|
||||||
description:
|
description: ${{ github.event.body }}
|
||||||
details: 'https://hub.docker.com/r/kizaing/kavita/tags?page=1&ordering=last_updated'
|
details: 'https://hub.docker.com/r/kizaing/kavita/tags?page=1&ordering=last_updated'
|
||||||
text: A new nightly build has been released for docker.
|
text: A new nightly build has been released for docker.
|
||||||
webhookUrl: ${{ secrets.DISCORD_DOCKER_UPDATE_URL }}
|
webhookUrl: ${{ secrets.DISCORD_DOCKER_UPDATE_URL }}
|
||||||
|
@ -370,32 +370,23 @@ namespace API.Data
|
|||||||
.Join(_context.AppUserProgresses, s => s.Id, progress => progress.SeriesId, (s, progress) => new
|
.Join(_context.AppUserProgresses, s => s.Id, progress => progress.SeriesId, (s, progress) => new
|
||||||
{
|
{
|
||||||
Series = s,
|
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,
|
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();
|
.AsNoTracking();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var retSeries = series.Where(s => s.AppUserId == userId
|
var retSeries = series.Where(s => s.AppUserId == userId
|
||||||
&& s.PagesRead > 0
|
&& s.PagesRead > 0
|
||||||
&& s.PagesRead < s.Series.Pages
|
&& s.PagesRead < s.Series.Pages)
|
||||||
/*&& userLibraries.Contains(s.Series.LibraryId)*/
|
|
||||||
/* && formats.Contains(s.Series.Format) */)
|
|
||||||
.OrderByDescending(s => s.LastModified)
|
.OrderByDescending(s => s.LastModified)
|
||||||
.Select(s => s.Series)
|
.Select(s => s.Series)
|
||||||
.ProjectTo<SeriesDto>(_mapper.ConfigurationProvider)
|
.ProjectTo<SeriesDto>(_mapper.ConfigurationProvider)
|
||||||
|
.AsSplitQuery()
|
||||||
.AsNoTracking();
|
.AsNoTracking();
|
||||||
|
|
||||||
// var retSeries = 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
|
||||||
// .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
|
|
||||||
return await retSeries.ToListAsync();
|
return await retSeries.ToListAsync();
|
||||||
//return await PagedList<SeriesDto>.CreateAsync(retSeries, userParams.PageNumber, userParams.PageSize);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<SeriesMetadataDto> GetSeriesMetadata(int seriesId)
|
public async Task<SeriesMetadataDto> GetSeriesMetadata(int seriesId)
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<TargetFramework>net5.0</TargetFramework>
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
<Company>kavitareader.com</Company>
|
<Company>kavitareader.com</Company>
|
||||||
<Product>Kavita</Product>
|
<Product>Kavita</Product>
|
||||||
<AssemblyVersion>0.4.3.7</AssemblyVersion>
|
<AssemblyVersion>0.4.3.8</AssemblyVersion>
|
||||||
<NeutralLanguage>en</NeutralLanguage>
|
<NeutralLanguage>en</NeutralLanguage>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user