Colorscape Love (#3326)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
parent
b44f89d1e8
commit
a847468a6c
42 changed files with 1009 additions and 429 deletions
|
|
@ -910,9 +910,14 @@ public class SeriesService : ISeriesService
|
|||
}
|
||||
|
||||
// Calculate the forecast for when the next chapter is expected
|
||||
var nextChapterExpected = chapters.Any()
|
||||
? chapters.Max(c => c.CreatedUtc) + TimeSpan.FromDays(forecastedTimeDifference)
|
||||
: (DateTime?)null;
|
||||
// var nextChapterExpected = chapters.Count > 0
|
||||
// ? chapters.Max(c => c.CreatedUtc) + TimeSpan.FromDays(forecastedTimeDifference)
|
||||
// : (DateTime?)null;
|
||||
var lastChapterDate = chapters.Max(c => c.CreatedUtc);
|
||||
var estimatedDate = lastChapterDate.AddDays(forecastedTimeDifference);
|
||||
var nextChapterExpected = estimatedDate.Day > DateTime.DaysInMonth(estimatedDate.Year, estimatedDate.Month)
|
||||
? new DateTime(estimatedDate.Year, estimatedDate.Month, DateTime.DaysInMonth(estimatedDate.Year, estimatedDate.Month))
|
||||
: estimatedDate;
|
||||
|
||||
// For number and volume number, we need the highest chapter, not the latest created
|
||||
var lastChapter = chapters.MaxBy(c => c.MaxNumber)!;
|
||||
|
|
@ -936,6 +941,7 @@ public class SeriesService : ISeriesService
|
|||
{
|
||||
LibraryType.Manga => await _localizationService.Translate(userId, "chapter-num", result.ChapterNumber),
|
||||
LibraryType.Comic => await _localizationService.Translate(userId, "issue-num", "#", result.ChapterNumber),
|
||||
LibraryType.ComicVine => await _localizationService.Translate(userId, "issue-num", "#", result.ChapterNumber),
|
||||
LibraryType.Book => await _localizationService.Translate(userId, "book-num", result.ChapterNumber),
|
||||
LibraryType.LightNovel => await _localizationService.Translate(userId, "book-num", result.ChapterNumber),
|
||||
_ => await _localizationService.Translate(userId, "chapter-num", result.ChapterNumber)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue