Fix 8 design majors: optional ILogger in libraries, IndexFactoryService singleton threading, SharedMediaTypeRegistry, required TrackDto fields, GetExtensionType dedup, PagedResult zero-guard, TrackService null-return on failure

This commit is contained in:
Daniel Harvey
2026-05-17 16:57:03 -04:00
parent fc5b8de81a
commit 4bd3be2eb8
11 changed files with 99 additions and 68 deletions
+2 -2
View File
@@ -4,8 +4,8 @@ public class TrackDto
{
public long Id { get; set; }
public required string EntryKey { get; set; }
public string TrackName { get; set; }
public string Artist { get; set; }
public required string TrackName { get; set; }
public required string Artist { get; set; }
public string? Album { get; set; }
public string? Genre { get; set; }
public DateOnly? ReleaseDate { get; set; }
+2 -2
View File
@@ -6,7 +6,7 @@ public class PagedResult<T>
public int TotalCount { get; set; }
public int Page { get; set; }
public int PageSize { get; set; }
public int TotalPages => (int)Math.Ceiling((double)TotalCount / PageSize);
public int TotalPages => PageSize > 0 ? (int)Math.Ceiling((double)TotalCount / PageSize) : 0;
public bool HasNextPage => Page < TotalPages;
public bool HasPreviousPage => Page > 1;
@@ -27,7 +27,7 @@ public class PagedResult<T>
public PagedResult(IEnumerable<T> items, int totalCount, int page, int pageSize)
{
Items = items.ToList() ?? new List<T>();
Items = items.ToList();
TotalCount = totalCount;
Page = page;
PageSize = pageSize;