From 9a1fa89f6f22f9fb4dc0b2bb3956158397542713 Mon Sep 17 00:00:00 2001 From: Robert McRackan Date: Thu, 27 Aug 2020 15:08:36 -0400 Subject: [PATCH] Grid, misc column: incl locale and acct --- LibationLauncher/LibationLauncher.csproj | 2 +- LibationWinForms/UNTESTED/GridEntry.cs | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/LibationLauncher/LibationLauncher.csproj b/LibationLauncher/LibationLauncher.csproj index 25fe47d1..183f5514 100644 --- a/LibationLauncher/LibationLauncher.csproj +++ b/LibationLauncher/LibationLauncher.csproj @@ -13,7 +13,7 @@ win-x64 - 3.1.12.302 + 3.1.12.303 diff --git a/LibationWinForms/UNTESTED/GridEntry.cs b/LibationWinForms/UNTESTED/GridEntry.cs index 19c471a6..39e4bce8 100644 --- a/LibationWinForms/UNTESTED/GridEntry.cs +++ b/LibationWinForms/UNTESTED/GridEntry.cs @@ -174,17 +174,28 @@ namespace LibationWinForms get { var details = new List(); + + var locale + = string.IsNullOrWhiteSpace(book.Locale) + ? "[unknown]" + : book.Locale; + var acct + = string.IsNullOrWhiteSpace(libraryBook.Account) + ? "[unknown]" + : libraryBook.Account; + details.Add($"Account: {locale} - {acct}"); + if (book.HasPdf) details.Add("Has PDF"); if (book.IsAbridged) details.Add("Abridged"); if (book.DatePublished.HasValue) - details.Add($"Date pub'd: {book.DatePublished.Value.ToString("MM/dd/yyyy")}"); + details.Add($"Date pub'd: {book.DatePublished.Value:MM/dd/yyyy}"); // this goes last since it's most likely to have a line-break if (!string.IsNullOrWhiteSpace(book.Publisher)) - details.Add($"Pub: {book.Publisher}"); + details.Add($"Pub: {book.Publisher.Trim()}"); - if (!details.Any()) + if (!details.Any()) return "[details not imported]"; return string.Join("\r\n", details);