Epub Annotation System (#4008)

Co-authored-by: Fesaa <77553571+Fesaa@users.noreply.github.com>
Co-authored-by: Robbie Davis <robbie@therobbiedavis.com>
This commit is contained in:
Joe Milazzo
2025-08-30 14:01:00 -05:00
committed by GitHub
parent 3b883b178f
commit b141613d60
170 changed files with 15837 additions and 3158 deletions
@@ -16,6 +16,7 @@ using API.DTOs.Filtering.v2;
using API.DTOs.KavitaPlus.Metadata;
using API.DTOs.Metadata;
using API.DTOs.Person;
using API.DTOs.Reader;
using API.DTOs.ReadingLists;
using API.DTOs.Recommendation;
using API.DTOs.Scrobbling;
@@ -402,6 +403,14 @@ public class SeriesRepository : ISeriesRepository
.ProjectTo<LibraryDto>(_mapper.ConfigurationProvider)
.ToListAsync();
result.Annotations = await _context.AppUserAnnotation
.Where(a => a.AppUserId == userId &&
(EF.Functions.Like(a.Comment, $"%{searchQueryNormalized}%") || EF.Functions.Like(a.Context, $"%{searchQueryNormalized}%")))
.Take(maxRecords)
.OrderBy(l => l.CreatedUtc)
.ProjectTo<AnnotationDto>(_mapper.ConfigurationProvider)
.ToListAsync();
var justYear = _yearRegex.Match(searchQuery).Value;
var hasYearInQuery = !string.IsNullOrEmpty(justYear);
var yearComparison = hasYearInQuery ? int.Parse(justYear) : 0;