From 4b2c8ee5131b7a6ecee34897919128b4cc39c9c3 Mon Sep 17 00:00:00 2001 From: Michael Bucari-Tovo Date: Fri, 2 Jul 2021 17:00:04 -0600 Subject: [PATCH] Add any subtitle to the title. --- DtoImporterService/BookImporter.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/DtoImporterService/BookImporter.cs b/DtoImporterService/BookImporter.cs index 4fe3a70e..157a3670 100644 --- a/DtoImporterService/BookImporter.cs +++ b/DtoImporterService/BookImporter.cs @@ -67,6 +67,9 @@ namespace DtoImporterService { var item = importItem.DtoItem; + //Add any subtitle after the title title. + var title = item.Title + (!string.IsNullOrWhiteSpace(item.Subtitle) ? $": {item.Subtitle}" : ""); + // absence of authors is very rare, but possible if (!item.Authors?.Any() ?? true) item.Authors = new[] { new Person { Name = "", Asin = null } }; @@ -102,7 +105,7 @@ namespace DtoImporterService var book = DbContext.Books.Add(new Book( new AudibleProductId(item.ProductId), - item.Title, + title, item.Description, item.LengthInMinutes, authors,