feat: add Book subtitle capturing so TitleShort reflects titles better

This commit is contained in:
Alanoll 2023-06-26 12:18:15 -05:00
parent 74ce408c8b
commit 2195574422
9 changed files with 482 additions and 9 deletions

View file

@ -8,7 +8,22 @@ namespace LibationFileManager
{
public string AudibleProductId { get; set; }
public string Title { get; set; }
public string Locale { get; set; }
public string Subtitle { get; set; }
public string TitleWithSubtitle
{
get
{
string text = Title?.Trim();
string text2 = Subtitle?.Trim();
if (string.IsNullOrWhiteSpace(text2))
{
return text;
}
return text + ": " + text2;
}
}
public string Locale { get; set; }
public int? YearPublished { get; set; }
public IEnumerable<string> Authors { get; set; }

View file

@ -57,7 +57,8 @@ namespace LibationFileManager
DateAdded = new DateTime(2022, 6, 9, 0, 0, 0),
DatePublished = new DateTime(2017, 2, 27, 0, 0, 0),
AudibleProductId = "123456789",
Title = "A Study in Scarlet: A Sherlock Holmes Novel",
Title = "A Study in Scarlet",
Subtitle = "A Sherlock Holmes Novel",
Locale = "us",
YearPublished = 2017,
Authors = new List<string> { "Arthur Conan Doyle", "Stephen Fry - introductions" },

View file

@ -247,8 +247,8 @@ namespace LibationFileManager
{
//Don't allow formatting of Id
{ TemplateTags.Id, lb => lb.AudibleProductId, v => v },
{ TemplateTags.Title, lb => lb.Title },
{ TemplateTags.TitleShort, lb => getTitleShort(lb.Title) },
{ TemplateTags.Title, lb => lb.TitleWithSubtitle },
{ TemplateTags.TitleShort, lb => lb.Title },
{ TemplateTags.Author, lb => lb.Authors, NameListFormat.Formatter },
{ TemplateTags.FirstAuthor, lb => lb.FirstAuthor },
{ TemplateTags.Narrator, lb => lb.Narrators, NameListFormat.Formatter },
@ -274,8 +274,8 @@ namespace LibationFileManager
{
new PropertyTagCollection<LibraryBookDto>(caseSensative: true, StringFormatter)
{
{ TemplateTags.Title, lb => lb.Title },
{ TemplateTags.TitleShort, lb => getTitleShort(lb.Title) },
{ TemplateTags.Title, lb => lb.TitleWithSubtitle },
{ TemplateTags.TitleShort, lb => lb.Title },
{ TemplateTags.Series, lb => lb.SeriesName },
},
new PropertyTagCollection<MultiConvertFileProperties>(caseSensative: true, StringFormatter, IntegerFormatter, DateTimeFormatter)