Safe code and changes

This commit is contained in:
2026-05-14 01:00:44 +02:00
parent 7f0266d914
commit 8ad203c974
25 changed files with 568 additions and 266 deletions
@@ -16,14 +16,16 @@ namespace Musify.Application.PlayLists.Handlers
{
var pageNumber = request.PageNumber < 1 ? 1 : request.PageNumber;
var pageSize = request.PageSize < 1 ? 10 : request.PageSize;
var normalizedName = request.Name?.Trim().ToUpperInvariant() ?? string.Empty;
var playListsQuery = database.PlayLists
.AsNoTracking()
.Where(p => p.UserId == request.UserId);
if (!string.IsNullOrWhiteSpace(normalizedName))
if (request.Name is not null)
{
var normalizedName = request.Name.Trim().ToUpperInvariant();
playListsQuery = playListsQuery.Where(p => p.NormalizedName.Contains(normalizedName));
}
var totalCount = await playListsQuery.CountAsync(cancellationToken);