diff --git a/API/Controllers/ChapterController.cs b/API/Controllers/ChapterController.cs index 9f2fc4c46..5bd239086 100644 --- a/API/Controllers/ChapterController.cs +++ b/API/Controllers/ChapterController.cs @@ -92,7 +92,7 @@ public async Task> DeleteChapter(int chapterId) /// Deletes multiple chapters and any volumes with no leftover chapters /// /// The ID of the series - /// The IDs of the chapters to be deleted + /// The IDs of the chapters to be deleted /// [Authorize(Policy = "RequireAdminRole")] [HttpPost("delete-multiple")] @@ -255,7 +255,7 @@ public async Task UpdateChapterMetadata(UpdateChapterDto dto) // Update writers await PersonHelper.UpdateChapterPeopleAsync( chapter, - dto.Writers.Select(p => Parser.Normalize(p.Name)).ToList(), + dto.Writers.Select(p => p.Name).ToList(), PersonRole.Writer, _unitOfWork ); @@ -263,7 +263,7 @@ await PersonHelper.UpdateChapterPeopleAsync( // Update characters await PersonHelper.UpdateChapterPeopleAsync( chapter, - dto.Characters.Select(p => Parser.Normalize(p.Name)).ToList(), + dto.Characters.Select(p => p.Name).ToList(), PersonRole.Character, _unitOfWork ); @@ -271,7 +271,7 @@ await PersonHelper.UpdateChapterPeopleAsync( // Update pencillers await PersonHelper.UpdateChapterPeopleAsync( chapter, - dto.Pencillers.Select(p => Parser.Normalize(p.Name)).ToList(), + dto.Pencillers.Select(p => p.Name).ToList(), PersonRole.Penciller, _unitOfWork ); @@ -279,7 +279,7 @@ await PersonHelper.UpdateChapterPeopleAsync( // Update inkers await PersonHelper.UpdateChapterPeopleAsync( chapter, - dto.Inkers.Select(p => Parser.Normalize(p.Name)).ToList(), + dto.Inkers.Select(p => p.Name).ToList(), PersonRole.Inker, _unitOfWork ); @@ -287,7 +287,7 @@ await PersonHelper.UpdateChapterPeopleAsync( // Update colorists await PersonHelper.UpdateChapterPeopleAsync( chapter, - dto.Colorists.Select(p => Parser.Normalize(p.Name)).ToList(), + dto.Colorists.Select(p => p.Name).ToList(), PersonRole.Colorist, _unitOfWork ); @@ -295,7 +295,7 @@ await PersonHelper.UpdateChapterPeopleAsync( // Update letterers await PersonHelper.UpdateChapterPeopleAsync( chapter, - dto.Letterers.Select(p => Parser.Normalize(p.Name)).ToList(), + dto.Letterers.Select(p => p.Name).ToList(), PersonRole.Letterer, _unitOfWork ); @@ -303,7 +303,7 @@ await PersonHelper.UpdateChapterPeopleAsync( // Update cover artists await PersonHelper.UpdateChapterPeopleAsync( chapter, - dto.CoverArtists.Select(p => Parser.Normalize(p.Name)).ToList(), + dto.CoverArtists.Select(p => p.Name).ToList(), PersonRole.CoverArtist, _unitOfWork ); @@ -311,7 +311,7 @@ await PersonHelper.UpdateChapterPeopleAsync( // Update editors await PersonHelper.UpdateChapterPeopleAsync( chapter, - dto.Editors.Select(p => Parser.Normalize(p.Name)).ToList(), + dto.Editors.Select(p => p.Name).ToList(), PersonRole.Editor, _unitOfWork ); @@ -319,7 +319,7 @@ await PersonHelper.UpdateChapterPeopleAsync( // Update publishers await PersonHelper.UpdateChapterPeopleAsync( chapter, - dto.Publishers.Select(p => Parser.Normalize(p.Name)).ToList(), + dto.Publishers.Select(p => p.Name).ToList(), PersonRole.Publisher, _unitOfWork ); @@ -327,7 +327,7 @@ await PersonHelper.UpdateChapterPeopleAsync( // Update translators await PersonHelper.UpdateChapterPeopleAsync( chapter, - dto.Translators.Select(p => Parser.Normalize(p.Name)).ToList(), + dto.Translators.Select(p => p.Name).ToList(), PersonRole.Translator, _unitOfWork ); @@ -335,7 +335,7 @@ await PersonHelper.UpdateChapterPeopleAsync( // Update imprints await PersonHelper.UpdateChapterPeopleAsync( chapter, - dto.Imprints.Select(p => Parser.Normalize(p.Name)).ToList(), + dto.Imprints.Select(p => p.Name).ToList(), PersonRole.Imprint, _unitOfWork ); @@ -343,7 +343,7 @@ await PersonHelper.UpdateChapterPeopleAsync( // Update teams await PersonHelper.UpdateChapterPeopleAsync( chapter, - dto.Teams.Select(p => Parser.Normalize(p.Name)).ToList(), + dto.Teams.Select(p => p.Name).ToList(), PersonRole.Team, _unitOfWork ); @@ -351,7 +351,7 @@ await PersonHelper.UpdateChapterPeopleAsync( // Update locations await PersonHelper.UpdateChapterPeopleAsync( chapter, - dto.Locations.Select(p => Parser.Normalize(p.Name)).ToList(), + dto.Locations.Select(p => p.Name).ToList(), PersonRole.Location, _unitOfWork ); diff --git a/API/Services/SeriesService.cs b/API/Services/SeriesService.cs index 119baaf94..7d4a4b95a 100644 --- a/API/Services/SeriesService.cs +++ b/API/Services/SeriesService.cs @@ -343,7 +343,7 @@ private async Task HandlePeopleUpdateAsync(SeriesMetadata metadata, ICollection< var existingPeople = await _unitOfWork.PersonRepository.GetPeopleByNames(normalizedNames); // Use a dictionary for quick lookups - var existingPeopleDictionary = existingPeople.ToDictionary(p => p.NormalizedName, p => p); + var existingPeopleDictionary = existingPeople.DistinctBy(p => p.NormalizedName).ToDictionary(p => p.NormalizedName, p => p); // List to track people that will be added to the metadata var peopleToAdd = new List();