#367 : New template option "year": year published to audible

This commit is contained in:
Robert McRackan 2022-10-21 13:41:44 -04:00
parent 99564d9c25
commit d64e043fe8
8 changed files with 13 additions and 5 deletions

View file

@ -9,6 +9,7 @@ namespace LibationFileManager
public string AudibleProductId { get; set; }
public string Title { get; set; }
public string Locale { get; set; }
public int? YearPublished { get; set; }
public IEnumerable<string> Authors { get; set; }
public string AuthorNames => string.Join(", ", Authors);

View file

@ -39,6 +39,7 @@ namespace LibationFileManager
public static TemplateTags Channels { get; } = new TemplateTags("channels", "Number of audio channels");
public static TemplateTags Account { get; } = new TemplateTags("account", "Audible account of this book");
public static TemplateTags Locale { get; } = new TemplateTags("locale", "Region/country");
public static TemplateTags YearPublished { get; } = new TemplateTags("year", "Year published");
// Special case. Isn't mapped to a replacement in Templates.cs
// Included here for display by EditTemplateDialog

View file

@ -142,8 +142,9 @@ namespace LibationFileManager
fileNamingTemplate.AddParameterReplacement(TemplateTags.Channels, libraryBookDto.Channels);
fileNamingTemplate.AddParameterReplacement(TemplateTags.Account, libraryBookDto.Account);
fileNamingTemplate.AddParameterReplacement(TemplateTags.Locale, libraryBookDto.Locale);
fileNamingTemplate.AddParameterReplacement(TemplateTags.YearPublished, libraryBookDto.YearPublished?.ToString() ?? "1900");
return fileNamingTemplate;
return fileNamingTemplate;
}
#endregion