Files
deepdrft/DeepDrftModels/DTOs/ReleaseFilter.cs
T
daniel-c-harvey 737c423d9c feat: replace /archive with release-cardinal searchable browser (Phase 9 §8.H)
Retire the three-card overview for a search + medium + genre browser over all
releases. Adds q/genre filter params to the api/release paged read path,
mirroring the existing api/track/page TrackFilter pattern.
2026-06-13 20:47:50 -04:00

26 lines
1.1 KiB
C#

namespace DeepDrftModels.DTOs;
/// <summary>
/// Cross-project release filter contract for the paged release read surface. Threaded alongside
/// (never inside) the external <c>PagingParameters&lt;T&gt;</c>, which cannot carry a where-clause,
/// and beside the medium filter (a separate enum param, not a free-text field). Mirrors
/// <see cref="TrackFilter"/> for the release-cardinal browse path. An instance with all properties
/// null is equivalent to no filter — see <see cref="IsEmpty"/>.
/// </summary>
public class ReleaseFilter
{
/// <summary>Free-text, case-insensitive LIKE across the release Title and Artist.</summary>
public string? SearchText { 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(Genre);
}