Bug fix #361 : import would break when audible erroneous duplicates a name in the author list or a name in the narrator list. (Note: the same name as both author and narrator has always been ok.)

This commit is contained in:
Robert McRackan 2022-08-17 20:05:47 -04:00
parent e0999dc9ae
commit 7ffdf45164
2 changed files with 5 additions and 3 deletions

View File

@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<Version>8.4.1.1</Version> <Version>8.4.2.1</Version>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Octokit" Version="2.0.0" /> <PackageReference Include="Octokit" Version="2.0.0" />

View File

@ -84,7 +84,8 @@ namespace DtoImporterService
// nested logic is required so order of names is retained. else, contributors may appear in the order they were inserted into the db // nested logic is required so order of names is retained. else, contributors may appear in the order they were inserted into the db
var authors = item var authors = item
.Authors .Authors
.Select(a => contributorImporter.Cache[a.Name]) .DistinctBy(a => a.Name)
.Select(a => contributorImporter.Cache[a.Name])
.ToList(); .ToList();
var narrators var narrators
@ -94,7 +95,8 @@ namespace DtoImporterService
// nested logic is required so order of names is retained. else, contributors may appear in the order they were inserted into the db // nested logic is required so order of names is retained. else, contributors may appear in the order they were inserted into the db
: item : item
.Narrators .Narrators
.Select(n => contributorImporter.Cache[n.Name]) .DistinctBy(a => a.Name)
.Select(n => contributorImporter.Cache[n.Name])
.ToList(); .ToList();
// categories are laid out for a breadcrumb. category is 1st, subcategory is 2nd // categories are laid out for a breadcrumb. category is 1st, subcategory is 2nd