Integrate new Title and Subtitle properties into Libation

This commit is contained in:
Mbucari 2023-06-29 19:55:16 -06:00
parent 2195574422
commit 83fa73cef5
27 changed files with 109 additions and 98 deletions

View file

@ -38,13 +38,14 @@ namespace LibationWinForms.Dialogs
// 1st draft: lazily cribbed from GridEntry.ctor()
private void initDetails()
{
this.Text = Book.Title;
this.Text = Book.TitleWithSubtitle;
(_, var picture) = PictureStorage.GetPicture(new PictureDefinition(Book.PictureId, PictureSize._80x80));
this.coverPb.Image = WinFormsUtil.TryLoadImageOrDefault(picture, PictureSize._80x80);
var title = string.IsNullOrEmpty(Book.Subtitle) ? Book.Title : $"{Book.Title}\r\n {Book.Subtitle}";
var t = @$"
Title: {Book.Title}
Title: {title}
Author(s): {Book.AuthorNames()}
Narrator(s): {Book.NarratorNames()}
Length: {(Book.LengthInMinutes == 0 ? "" : $"{Book.LengthInMinutes / 60} hr {Book.LengthInMinutes % 60} min")}

View file

@ -45,7 +45,7 @@ namespace LibationWinForms.Dialogs
{
this.libraryBook = libraryBook;
Text = $"{libraryBook.Book.Title} - Clips and Bookmarks";
Text = $"{libraryBook.Book.TitleWithSubtitle} - Clips and Bookmarks";
}
private async void BookRecordsDialog_Shown(object sender, EventArgs e)
@ -182,7 +182,7 @@ namespace LibationWinForms.Dialogs
{
Title = "Where to export records",
AddExtension = true,
FileName = $"{libraryBook.Book.Title} - Records",
FileName = $"{libraryBook.Book.TitleWithSubtitle} - Records",
DefaultExt = "xlsx",
Filter = "Excel Workbook (*.xlsx)|*.xlsx|CSV files (*.csv)|*.csv|JSON files (*.json)|*.json" // + "|All files (*.*)|*.*"
});

View file

@ -176,7 +176,7 @@ namespace LibationWinForms.GridView
{
var openFileDialog = new OpenFileDialog
{
Title = $"Locate the audio file for '{entry.Book.Title}'",
Title = $"Locate the audio file for '{entry.Book.TitleWithSubtitle}'",
Filter = "All files (*.*)|*.*",
FilterIndex = 1
};

View file

@ -77,7 +77,7 @@ namespace LibationWinForms.ProcessQueue
LibraryBook = libraryBook;
Logger = logme;
title = LibraryBook.Book.Title;
title = LibraryBook.Book.TitleWithSubtitle;
authorNames = LibraryBook.Book.AuthorNames();
narratorNames = LibraryBook.Book.NarratorNames();
_bookText = $"{title}\r\nBy {authorNames}\r\nNarrated by {narratorNames}";
@ -291,7 +291,7 @@ namespace LibationWinForms.ProcessQueue
Logger.Info($"{Environment.NewLine}{((Processable)sender).Name} Step, Begin: {libraryBook.Book}");
title = libraryBook.Book.Title;
title = libraryBook.Book.TitleWithSubtitle;
authorNames = libraryBook.Book.AuthorNames();
narratorNames = libraryBook.Book.NarratorNames();
updateBookInfo();
@ -359,7 +359,7 @@ namespace LibationWinForms.ProcessQueue
: str;
details =
$@" Title: {libraryBook.Book.Title}
$@" Title: {libraryBook.Book.TitleWithSubtitle}
ID: {libraryBook.Book.AudibleProductId}
Author: {trunc(libraryBook.Book.AuthorNames())}
Narr: {trunc(libraryBook.Book.NarratorNames())}";
@ -379,7 +379,7 @@ $@" Title: {libraryBook.Book.Title}
{
libraryBook.UpdateBookStatus(LiberatedStatus.Error);
Logger.Info($"Error. Skip: [{libraryBook.Book.AudibleProductId}] {libraryBook.Book.Title}");
Logger.Info($"Error. Skip: [{libraryBook.Book.AudibleProductId}] {libraryBook.Book.TitleWithSubtitle}");
return ProcessBookResult.FailedSkip;
}

View file

@ -188,7 +188,7 @@ namespace LibationWinForms.ProcessQueue
else if (result == ProcessBookResult.LicenseDeniedPossibleOutage && !shownServiceOutageMessage)
{
MessageBox.Show(@$"
You were denied a content license for {nextBook.LibraryBook.Book.Title}
You were denied a content license for {nextBook.LibraryBook.Book.TitleWithSubtitle}
This error appears to be caused by a temporary interruption of service that sometimes affects Libation's users. This type of error usually resolves itself in 1 to 2 days, and in the meantime you should still be able to access your books through Audible's website or app.
",