changes per Mbucari

This commit is contained in:
delebash
2025-10-20 16:31:06 -04:00
parent f7cd2b106b
commit fd95ac7a9c
2 changed files with 4 additions and 2 deletions

View File

@@ -130,9 +130,10 @@ namespace LibationUiBase.GridView
protected abstract string GetBookTags();
protected virtual DateTime GetPurchaseDate() => LibraryBook.DateAdded;
protected virtual DateTime? GetIncludedUntil() => LibraryBook.IncludedUntil;
protected virtual int GetLengthInMinutes() => Book.LengthInMinutes;
protected string GetPurchaseDateString() => GetPurchaseDate().ToString("d");
protected string GetIncludedUntilString() => LibraryBook.IncludedUntil?.ToString("d") ?? string.Empty;
protected string GetIncludedUntilString() => GetIncludedUntil()?.ToString("d") ?? string.Empty;
protected string GetBookLengthString()
{
int bookLenMins = GetLengthInMinutes();
@@ -213,7 +214,7 @@ namespace LibationUiBase.GridView
nameof(Liberate) => Liberate,
nameof(DateAdded) => DateAdded,
nameof(IsSpatial) => IsSpatial,
nameof(IncludedUntil) => IncludedUntil,
nameof(IncludedUntil) => GetIncludedUntil() ?? default,
_ => null
};

View File

@@ -102,5 +102,6 @@ namespace LibationUiBase.GridView
protected override string GetBookTags() => null;
protected override int GetLengthInMinutes() => Children.Count == 0 ? 0 : Children.Sum(c => c.LibraryBook.Book.LengthInMinutes);
protected override DateTime GetPurchaseDate() => Children.Count == 0 ? default : Children.Min(c => c.LibraryBook.DateAdded);
protected override DateTime? GetIncludedUntil() => Children.Count == 0 ? default : Children.Min(c => c.LibraryBook.IncludedUntil);
}
}