Fix Unit Tests
This commit is contained in:
parent
f29c63c6c4
commit
749fb24185
7 changed files with 219 additions and 178 deletions
|
|
@ -1086,6 +1086,8 @@ public class ExternalMetadataService : IExternalMetadataService
|
|||
|
||||
madeModification = await UpdateChapterCoverImage(chapter, settings, potentialMatch.CoverImageUrl) || madeModification;
|
||||
|
||||
madeModification = await UpdateChapterReviews(chapter, settings, potentialMatch) || madeModification;
|
||||
|
||||
_unitOfWork.ChapterRepository.Update(chapter);
|
||||
await _unitOfWork.CommitAsync();
|
||||
}
|
||||
|
|
@ -1094,6 +1096,18 @@ public class ExternalMetadataService : IExternalMetadataService
|
|||
return madeModification;
|
||||
}
|
||||
|
||||
private async Task<bool> UpdateChapterReviews(Chapter chapter, MetadataSettingsDto settings, ExternalChapterDto metadata)
|
||||
{
|
||||
if (!settings.Enabled) return false;
|
||||
|
||||
if (metadata.UserReviews.Count == 0 && metadata.CriticReviews.Count == 0) return false;
|
||||
|
||||
// Clear current ratings
|
||||
chapter.Ratings.Clear();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
private static bool UpdateChapterSummary(Chapter chapter, MetadataSettingsDto settings, string? summary)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue