Increase tag template options for contributor and series types
- Add template tag support for multiple series - Add series ID and contributor ID to template tags - <first author> and <first narrator> are now name types with name formatter support - Properly import contributor IDs into database - Updated docs
This commit is contained in:
parent
0a9e489f48
commit
7d806e0f3e
31 changed files with 425 additions and 255 deletions
27
Source/LibationFileManager/Templates/SeriesDto.cs
Normal file
27
Source/LibationFileManager/Templates/SeriesDto.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
using System;
|
||||
|
||||
#nullable enable
|
||||
namespace LibationFileManager.Templates;
|
||||
|
||||
public record SeriesDto : IFormattable
|
||||
{
|
||||
public string Name { get; }
|
||||
|
||||
public float? Number { get; }
|
||||
public string AudibleSeriesId { get; }
|
||||
public SeriesDto(string name, float? number, string audibleSeriesId)
|
||||
{
|
||||
Name = name;
|
||||
Number = number;
|
||||
AudibleSeriesId = audibleSeriesId;
|
||||
}
|
||||
|
||||
public override string ToString() => Name.Trim();
|
||||
public string ToString(string? format, IFormatProvider? _)
|
||||
=> string.IsNullOrWhiteSpace(format) ? ToString()
|
||||
: format
|
||||
.Replace("{N}", Name)
|
||||
.Replace("{#}", Number?.ToString())
|
||||
.Replace("{ID}", AudibleSeriesId)
|
||||
.Trim();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue