Bugfix. Audible changed how they handle categories, causing a new bug. Temp fix to get everything working again

This commit is contained in:
Robert McRackan 2020-05-26 14:38:29 -04:00
parent f28a729d36
commit 53f252e56f
3 changed files with 5 additions and 4 deletions

View File

@ -51,6 +51,10 @@ namespace DtoImporterService
{ {
for (var i = 0; i < pair.Length; i++) for (var i = 0; i < pair.Length; i++)
{ {
// not yet supported: depth beyond 0 and 1
if (i > 1)
break;
var id = pair[i].CategoryId; var id = pair[i].CategoryId;
var name = pair[i].CategoryName; var name = pair[i].CategoryName;

View File

@ -51,9 +51,6 @@ namespace InternalUtilities
if (distinct.Any(s => s.CategoryName is null)) if (distinct.Any(s => s.CategoryName is null))
exceptions.Add(new ArgumentException($"Collection contains {nameof(Item.Categories)} with null {nameof(Ladder.CategoryName)}", nameof(items))); exceptions.Add(new ArgumentException($"Collection contains {nameof(Item.Categories)} with null {nameof(Ladder.CategoryName)}", nameof(items)));
if (items.GetCategoryPairsDistinct().Any(p => p.Length > 2))
exceptions.Add(new ArgumentException($"Collection contains {nameof(Item.Categories)} with wrong number of categories. Expecting 0, 1, or 2 categories per title", nameof(items)));
return exceptions; return exceptions;
} }
} }

View File

@ -13,7 +13,7 @@
<!-- <PublishSingleFile>true</PublishSingleFile> --> <!-- <PublishSingleFile>true</PublishSingleFile> -->
<RuntimeIdentifier>win-x64</RuntimeIdentifier> <RuntimeIdentifier>win-x64</RuntimeIdentifier>
<Version>3.1.9.1</Version> <Version>3.1.10.1</Version>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>