Skip to content

Commit

Permalink
Fixed a bug where LibraryType and MaxChaptersInASeries wasn't hooked …
Browse files Browse the repository at this point in the history
…up correctly
  • Loading branch information
majora2007 committed Dec 8, 2024
1 parent 0a7bc4b commit fffc21a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion API/Services/Tasks/StatsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using API.Entities;
using API.Entities.Enums;
using API.Services.Plus;
using API.Services.Tasks.Scanner.Parser;
using Flurl.Http;
using Kavita.Common.EnvironmentInfo;
using Kavita.Common.Helpers;
Expand Down Expand Up @@ -231,11 +232,12 @@ private async Task<int> MaxChaptersInASeries()
{
// If first time flow, just return 0
if (!await _context.Chapter.AnyAsync()) return 0;

return await _context.Series
.AsNoTracking()
.AsSplitQuery()
.MaxAsync(s => s.Volumes!
.Where(v => v.MinNumber == 0)
.Where(v => v.MinNumber == Parser.LooseLeafVolumeNumber)
.SelectMany(v => v.Chapters!)
.Count());
}
Expand Down Expand Up @@ -314,6 +316,7 @@ private async Task<ServerInfoV3Dto> GetStatV3Payload()
libDto.UsingFolderWatching = library.FolderWatching;
libDto.CreateCollectionsFromMetadata = library.ManageCollections;
libDto.CreateReadingListsFromMetadata = library.ManageReadingLists;
libDto.LibraryType = library.Type;

dto.Libraries.Add(libDto);
}
Expand Down

0 comments on commit fffc21a

Please sign in to comment.