feat: add search/album/genre filtering and /albums + /genres browse pages

This commit is contained in:
daniel-c-harvey
2026-06-10 10:54:56 -04:00
parent 1071ba7374
commit 5cae83b9ed
24 changed files with 940 additions and 15 deletions
+14
View File
@@ -0,0 +1,14 @@
namespace DeepDrftModels.DTOs;
/// <summary>
/// One distinct album with its track count and a representative cover image key. Backs the
/// /albums browse grid.
/// </summary>
public class AlbumSummaryDto
{
public required string Album { get; set; }
public int TrackCount { get; set; }
/// <summary>ImagePath of the first track in the album that has one; null when none do.</summary>
public string? CoverImageKey { get; set; }
}
+8
View File
@@ -0,0 +1,8 @@
namespace DeepDrftModels.DTOs;
/// <summary>One distinct genre with its track count. Backs the /genres browse list.</summary>
public class GenreSummaryDto
{
public required string Genre { get; set; }
public int TrackCount { get; set; }
}
+27
View File
@@ -0,0 +1,27 @@
namespace DeepDrftModels.DTOs;
/// <summary>
/// Cross-project track filter contract. Threaded alongside (never inside) the external
/// <c>PagingParameters&lt;T&gt;</c>, which cannot carry a where-clause. An instance with all
/// properties null is equivalent to no filter — see <c>TrackFilter.IsEmpty</c>.
/// </summary>
public class TrackFilter
{
/// <summary>Free-text, case-insensitive LIKE across TrackName, Artist, and Album.</summary>
public string? SearchText { get; set; }
/// <summary>Exact album match.</summary>
public string? Album { get; set; }
/// <summary>Exact genre match.</summary>
public string? Genre { get; set; }
/// <summary>
/// True when no predicate is set. An empty filter must produce identical results to a null
/// filter, so callers collapse it to null before querying.
/// </summary>
public bool IsEmpty =>
string.IsNullOrWhiteSpace(SearchText)
&& string.IsNullOrWhiteSpace(Album)
&& string.IsNullOrWhiteSpace(Genre);
}