feat: add search/album/genre filtering and /albums + /genres browse pages
This commit is contained in:
@@ -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; }
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
namespace DeepDrftModels.DTOs;
|
||||
|
||||
/// <summary>
|
||||
/// Cross-project track filter contract. Threaded alongside (never inside) the external
|
||||
/// <c>PagingParameters<T></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);
|
||||
}
|
||||
Reference in New Issue
Block a user