Bugfix/tachiyomi sync issue (#1002)

* Added extra unit cases for GetContinuePoint. Fixed a bug where if the series was just read chapters, the first chapter wouldn't be returned and would throw an error.

* Wrote unit tests for MarkChaptersUntilAsRead for Tachiyomi and fixed a few cases where due to tracking on Tachiyomi, Volumes with a single 0 chapter would get marked as read.
This commit is contained in:
Joseph Milazzo 2022-01-28 06:29:49 -08:00 committed by GitHub
parent c9bd1d1bfb
commit 567d475e46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 306 additions and 21 deletions

View file

@ -392,12 +392,7 @@ namespace API.Controllers
var user = await _unitOfWork.UserRepository.GetUserByUsernameAsync(User.GetUsername(), AppUserIncludes.Progress);
user.Progresses ??= new List<AppUserProgress>();
var volumes = await _unitOfWork.VolumeRepository.GetVolumesForSeriesAsync(new List<int>() { seriesId }, true);
foreach (var volume in volumes.OrderBy(v => v.Number))
{
var chapters = volume.Chapters.OrderBy(c => float.Parse(c.Number)).Where(c => !c.IsSpecial && Parser.Parser.MaximumNumberFromRange(c.Range) <= chapterNumber);
_readerService.MarkChaptersAsRead(user, volume.SeriesId, chapters);
}
await _readerService.MarkChaptersUntilAsRead(user, seriesId, chapterNumber);
_unitOfWork.UserRepository.Update(user);