Changes on packages
This commit is contained in:
@@ -20,7 +20,7 @@ namespace Musify.Application.Albums
|
||||
var album = await database.Albums
|
||||
.AsNoTracking()
|
||||
.SingleOrDefaultAsync(a => a.Id == request.AlbumId, cancellationToken);
|
||||
if (album is null)
|
||||
if (album == null)
|
||||
{
|
||||
logger.LogInformation("Album {AlbumId} not found", request.AlbumId);
|
||||
return Error.NotFound();
|
||||
@@ -35,7 +35,7 @@ namespace Musify.Application.Albums
|
||||
var track = await database.Tracks
|
||||
.AsNoTracking()
|
||||
.SingleOrDefaultAsync(t => t.Id == request.TrackId, cancellationToken);
|
||||
if (track is null)
|
||||
if (track == null)
|
||||
{
|
||||
logger.LogInformation("Track {TrackId} not found", request.TrackId);
|
||||
return Error.NotFound(description: $"Track {request.TrackId} not found");
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Musify.Application.Albums
|
||||
{
|
||||
var album = await database.Albums
|
||||
.SingleOrDefaultAsync(a => a.Id == request.AlbumId, cancellationToken);
|
||||
if (album is null)
|
||||
if (album == null)
|
||||
{
|
||||
logger.LogDebug("Album {AlbumId} not found", request.AlbumId);
|
||||
return Error.NotFound();
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Musify.Application.Albums
|
||||
})
|
||||
.SingleOrDefaultAsync(cancellationToken);
|
||||
|
||||
if (album is null)
|
||||
if (album == null)
|
||||
return Error.NotFound();
|
||||
|
||||
return AlbumApplicationResponse.FromEntity(album.Album, album.TrackCount, album.CoverTrackIds);
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Musify.Application.Albums
|
||||
.Select(a => a.Pictures)
|
||||
.SingleOrDefaultAsync(cancellationToken);
|
||||
|
||||
if (pictures is null)
|
||||
if (pictures == null)
|
||||
return Error.NotFound();
|
||||
|
||||
var routes = albumConfiguration.Routes;
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Musify.Application.Albums
|
||||
var album = await database.Albums
|
||||
.AsNoTracking()
|
||||
.SingleOrDefaultAsync(a => a.Id == request.AlbumId, cancellationToken);
|
||||
if (album is null)
|
||||
if (album == null)
|
||||
{
|
||||
logger.LogInformation("Album {AlbumId} not found", request.AlbumId);
|
||||
return Error.NotFound();
|
||||
@@ -37,7 +37,7 @@ namespace Musify.Application.Albums
|
||||
.ToListAsync(cancellationToken);
|
||||
|
||||
var link = albumTracks.SingleOrDefault(albumTrack => albumTrack.TrackId == request.TrackId);
|
||||
if (link is null)
|
||||
if (link == null)
|
||||
{
|
||||
logger.LogInformation("Track {TrackId} not in album {AlbumId}", request.TrackId, request.AlbumId);
|
||||
return Error.NotFound(description: "Track is not in the album.");
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Musify.Application.Albums
|
||||
{
|
||||
var album = await database.Albums
|
||||
.SingleOrDefaultAsync(a => a.Id == request.AlbumId, cancellationToken);
|
||||
if (album is null)
|
||||
if (album == null)
|
||||
{
|
||||
logger.LogInformation("Album {AlbumId} not found", request.AlbumId);
|
||||
return Error.NotFound();
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Musify.Application.Likes
|
||||
.SingleOrDefaultAsync(like => like.UserId == request.UserId && like.TrackId == request.TrackId, cancellationToken);
|
||||
|
||||
bool nowLiked;
|
||||
if (existingLike is not null)
|
||||
if (existingLike != null)
|
||||
{
|
||||
database.TrackLikes.Remove(existingLike);
|
||||
nowLiked = false;
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Musify.Application.Mixes
|
||||
.Include(mix => mix.Items)
|
||||
.SingleOrDefaultAsync(mix => mix.Id == request.MixId && mix.UserId == request.UserId, cancellationToken);
|
||||
|
||||
if (mix is null)
|
||||
if (mix == null)
|
||||
return Error.NotFound(description: $"Mix {request.MixId} was not found");
|
||||
|
||||
var orderedItems = mix.Items.OrderBy(item => item.Position).ToList();
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Musify.Application.PlayLists
|
||||
{
|
||||
var playList = await database.PlayLists
|
||||
.SingleOrDefaultAsync(pl => pl.Id == request.PlayListId, cancellationToken);
|
||||
if (playList is null)
|
||||
if (playList == null)
|
||||
{
|
||||
logger.LogInformation("Playlist {PlayListId} not found", request.PlayListId);
|
||||
return Error.NotFound();
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Musify.Application.PlayLists
|
||||
public async ValueTask<ErrorOr<Success>> Handle(DeletePlayListCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
var playList = await database.PlayLists.SingleOrDefaultAsync(p => p.Id == request.PlayListId, cancellationToken);
|
||||
if (playList is null)
|
||||
if (playList == null)
|
||||
{
|
||||
logger.LogDebug("Playlist {PlayListId} not found", request.PlayListId);
|
||||
return Error.NotFound();
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Musify.Application.PlayLists
|
||||
})
|
||||
.SingleOrDefaultAsync(cancellationToken);
|
||||
|
||||
if (entry is null)
|
||||
if (entry == null)
|
||||
return Error.NotFound();
|
||||
|
||||
if (entry.PlayList.Visibility == PlaylistVisibility.Private
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Musify.Application.PlayLists
|
||||
.Select(p => p.Pictures)
|
||||
.SingleOrDefaultAsync(cancellationToken);
|
||||
|
||||
if (pictures is null)
|
||||
if (pictures == null)
|
||||
return Error.NotFound();
|
||||
|
||||
var routes = playListConfiguration.Routes;
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Musify.Application.PlayLists
|
||||
{
|
||||
var playList = await database.PlayLists
|
||||
.SingleOrDefaultAsync(pl => pl.Id == request.PlayListId, cancellationToken);
|
||||
if (playList is null)
|
||||
if (playList == null)
|
||||
{
|
||||
logger.LogInformation("Playlist {PlayListId} not found", request.PlayListId);
|
||||
return Error.NotFound();
|
||||
@@ -32,7 +32,7 @@ namespace Musify.Application.PlayLists
|
||||
|
||||
var link = await database.PlayListHasTracks
|
||||
.SingleOrDefaultAsync(plt => plt.PlayListId == request.PlayListId && plt.TrackId == request.TrackId, cancellationToken);
|
||||
if (link is null)
|
||||
if (link == null)
|
||||
{
|
||||
logger.LogInformation("Track {TrackId} not in playlist {PlayListId}", request.TrackId, request.PlayListId);
|
||||
return Error.NotFound(description: "Track is not in the playlist.");
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Musify.Application.PlayLists
|
||||
public async ValueTask<ErrorOr<PlayListApplicationResponse>> Handle(UpdatePlayListCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
var playListEntity = await database.PlayLists.SingleOrDefaultAsync(pl => pl.Id == request.PlayListId, cancellationToken);
|
||||
if (playListEntity is null)
|
||||
if (playListEntity == null)
|
||||
{
|
||||
logger.LogInformation("Playlist {PlayListId} not found", request.PlayListId);
|
||||
return Error.NotFound();
|
||||
|
||||
@@ -32,7 +32,7 @@ public sealed class TrackStreamIssuer(
|
||||
|
||||
// Anonymous listeners have no User row to satisfy ListeningHistory's foreign key against, and
|
||||
// their plays aren't "history" anyone can look back on anyway, so there's nothing to record.
|
||||
if (userId is not null)
|
||||
if (userId != null)
|
||||
{
|
||||
var newListeningHistory = new ListeningHistory
|
||||
{
|
||||
@@ -48,7 +48,7 @@ public sealed class TrackStreamIssuer(
|
||||
|
||||
private long? AnonymousFragmentBytes(long? userId)
|
||||
{
|
||||
if (userId is not null || playbackConfiguration.AnonymousFragmentSeconds <= 0)
|
||||
if (userId != null || playbackConfiguration.AnonymousFragmentSeconds <= 0)
|
||||
return null;
|
||||
|
||||
return (long)playbackConfiguration.AnonymousFragmentSeconds * playbackConfiguration.EstimatedAudioBytesPerSecond;
|
||||
|
||||
@@ -42,7 +42,7 @@ public sealed class UploadIntentValidator(
|
||||
var intent = await database.UploadIntents
|
||||
.FirstOrDefaultAsync(i => i.Id == intentId, cancellationToken);
|
||||
|
||||
if (intent is null || intent.UserId != userId)
|
||||
if (intent == null || intent.UserId != userId)
|
||||
return Error.NotFound(description: "Upload intent not found or not accessible.");
|
||||
|
||||
if (intent.IsConsumed)
|
||||
@@ -52,7 +52,7 @@ public sealed class UploadIntentValidator(
|
||||
return Error.Validation(description: "Upload intent has expired.");
|
||||
|
||||
var metadata = await storageService.HeadObjectAsync(intent.Bucket, intent.Key, cancellationToken);
|
||||
if (metadata is null)
|
||||
if (metadata == null)
|
||||
return Error.NotFound(description: "Uploaded object not found in storage. Upload the file first.");
|
||||
|
||||
if (metadata.ContentLength > config.MaxUploadBytes)
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Musify.Application.Tracks
|
||||
{
|
||||
var user = await database.Users
|
||||
.SingleOrDefaultAsync(u => u.Id == request.UserId, cancellationToken);
|
||||
if (user is null)
|
||||
if (user == null)
|
||||
{
|
||||
logger.LogWarning("User {UserId} not found", request.UserId);
|
||||
return Error.NotFound(description: $"User {request.UserId} not found");
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Musify.Application.Tracks
|
||||
public async ValueTask<ErrorOr<Success>> Handle(DeleteTrackCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
var track = await database.Tracks.SingleOrDefaultAsync(t => t.Id == request.TrackId, cancellationToken);
|
||||
if (track is null)
|
||||
if (track == null)
|
||||
{
|
||||
logger.LogInformation("Track {TrackId} not found", request.TrackId);
|
||||
return Error.NotFound();
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Musify.Application.Tracks
|
||||
.Select(t => new { Track = t, ListensCount = t.ListeningHistories.Count })
|
||||
.SingleOrDefaultAsync(cancellationToken);
|
||||
|
||||
if (entity is null)
|
||||
if (entity == null)
|
||||
return Error.NotFound();
|
||||
|
||||
return TrackApplicationResponse.FromEntity(entity.Track, entity.ListensCount);
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Musify.Application.Tracks
|
||||
{
|
||||
public async ValueTask<ErrorOr<TrackStreamResponse>> Handle(GetTrackStreamQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
if (request.UserId is null && !playbackConfiguration.AllowAnonymousListening)
|
||||
if (request.UserId == null && !playbackConfiguration.AllowAnonymousListening)
|
||||
return Error.Unauthorized(description: "Sign in to stream music, or ask an administrator to enable anonymous listening.");
|
||||
|
||||
var track = await database.Tracks.AsNoTracking()
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Musify.Application.Users
|
||||
.Select(u => UserApplicationResponse.FromEntity(u))
|
||||
.SingleOrDefaultAsync(cancellationToken);
|
||||
|
||||
if (user is null)
|
||||
if (user == null)
|
||||
return Error.NotFound();
|
||||
|
||||
return user;
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Musify.Application.Users
|
||||
})
|
||||
.SingleOrDefaultAsync(cancellationToken);
|
||||
|
||||
if (user is null)
|
||||
if (user == null)
|
||||
return Error.NotFound();
|
||||
|
||||
var followersCount = await database.UserFollows
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Musify.Application.Users
|
||||
var user = await database.Users
|
||||
.SingleOrDefaultAsync(u => u.Id == request.Id, cancellationToken);
|
||||
|
||||
if (user is null)
|
||||
if (user == null)
|
||||
{
|
||||
await database.Users.AddAsync(new User
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Musify.Application.Users
|
||||
var follow = await database.UserFollows
|
||||
.SingleOrDefaultAsync(f => f.FollowerId == request.FollowerId && f.FollowedId == request.FollowedId, cancellationToken);
|
||||
|
||||
if (follow is null)
|
||||
if (follow == null)
|
||||
return new Success();
|
||||
|
||||
database.UserFollows.Remove(follow);
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ namespace Musify.Infrastructure.MassTransit.Activities.Albums
|
||||
var album = await database.Albums
|
||||
.SingleOrDefaultAsync(a => a.Id == executeContext.Arguments.AlbumId, executeContext.CancellationToken);
|
||||
|
||||
if (album is not null)
|
||||
if (album != null)
|
||||
{
|
||||
album.LifeCycleStatus = LifeCycleStatus.Failed;
|
||||
await database.SaveChangesAsync(executeContext.CancellationToken);
|
||||
|
||||
+1
-1
@@ -93,7 +93,7 @@ namespace Musify.Infrastructure.MassTransit.Activities.Audio
|
||||
try
|
||||
{
|
||||
var track = await database.Tracks.SingleOrDefaultAsync(t => t.Id == compensateContext.Log.TrackId, compensateContext.CancellationToken);
|
||||
if (track is null)
|
||||
if (track == null)
|
||||
throw new InvalidOperationException($"Track with id {compensateContext.Log.TrackId} not found");
|
||||
|
||||
track.Audio.FolderName = compensateContext.Log.PreviousAudioFolderName;
|
||||
|
||||
+3
-3
@@ -31,14 +31,14 @@ namespace Musify.Infrastructure.MassTransit.Activities.Pictures
|
||||
[executeContext.Arguments.AlbumId],
|
||||
cancellationToken: executeContext.CancellationToken);
|
||||
|
||||
if (album is null)
|
||||
if (album == null)
|
||||
{
|
||||
logger.LogWarning("Album {AlbumId} not found",
|
||||
executeContext.Arguments.AlbumId);
|
||||
throw new InvalidOperationException($"Album with id {executeContext.Arguments.AlbumId} not found");
|
||||
}
|
||||
|
||||
if (album.Pictures is null)
|
||||
if (album.Pictures == null)
|
||||
{
|
||||
logger.LogWarning("Album {AlbumId} has no pending picture upload",
|
||||
executeContext.Arguments.AlbumId);
|
||||
@@ -85,7 +85,7 @@ namespace Musify.Infrastructure.MassTransit.Activities.Pictures
|
||||
[compensateContext.Log.AlbumId],
|
||||
cancellationToken: compensateContext.CancellationToken);
|
||||
|
||||
if (album is null)
|
||||
if (album == null)
|
||||
{
|
||||
return compensateContext.Compensated();
|
||||
}
|
||||
|
||||
+3
-3
@@ -31,14 +31,14 @@ namespace Musify.Infrastructure.MassTransit.Activities.Pictures
|
||||
[executeContext.Arguments.PlayListId],
|
||||
cancellationToken: executeContext.CancellationToken);
|
||||
|
||||
if (playList is null)
|
||||
if (playList == null)
|
||||
{
|
||||
logger.LogWarning("Playlist {PlayListId} not found",
|
||||
executeContext.Arguments.PlayListId);
|
||||
throw new InvalidOperationException($"PlayList with id {executeContext.Arguments.PlayListId} not found");
|
||||
}
|
||||
|
||||
if (playList.Pictures is null)
|
||||
if (playList.Pictures == null)
|
||||
{
|
||||
logger.LogWarning("Playlist {PlayListId} has no pending picture upload",
|
||||
executeContext.Arguments.PlayListId);
|
||||
@@ -85,7 +85,7 @@ namespace Musify.Infrastructure.MassTransit.Activities.Pictures
|
||||
[compensateContext.Log.PlayListId],
|
||||
cancellationToken: compensateContext.CancellationToken);
|
||||
|
||||
if (playList is null)
|
||||
if (playList == null)
|
||||
{
|
||||
return compensateContext.Compensated();
|
||||
}
|
||||
|
||||
+2
-2
@@ -31,7 +31,7 @@ namespace Musify.Infrastructure.MassTransit.Activities.Pictures
|
||||
[executeContext.Arguments.TrackId],
|
||||
cancellationToken: executeContext.CancellationToken);
|
||||
|
||||
if (track is null)
|
||||
if (track == null)
|
||||
{
|
||||
logger.LogWarning("Track {TrackId} not found",
|
||||
executeContext.Arguments.TrackId);
|
||||
@@ -79,7 +79,7 @@ namespace Musify.Infrastructure.MassTransit.Activities.Pictures
|
||||
[compensateContext.Log.TrackId],
|
||||
cancellationToken: compensateContext.CancellationToken);
|
||||
|
||||
if (track is null)
|
||||
if (track == null)
|
||||
return compensateContext.Compensated();
|
||||
|
||||
track.Pictures.OriginalName = compensateContext.Log.PreviousOriginalPictureKey;
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ namespace Musify.Infrastructure.MassTransit.Activities.PlayLists
|
||||
var playList = await database.PlayLists
|
||||
.SingleOrDefaultAsync(p => p.Id == executeContext.Arguments.PlayListId, executeContext.CancellationToken);
|
||||
|
||||
if (playList is null)
|
||||
if (playList == null)
|
||||
{
|
||||
logger.LogInformation(
|
||||
"PlayList {PlayListId} not found while deleting from DB, skipping",
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ namespace Musify.Infrastructure.MassTransit.Activities.PlayLists
|
||||
var playList = await database.PlayLists
|
||||
.SingleOrDefaultAsync(p => p.Id == executeContext.Arguments.PlayListId, executeContext.CancellationToken);
|
||||
|
||||
if (playList is not null)
|
||||
if (playList != null)
|
||||
{
|
||||
playList.LifeCycleStatus = LifeCycleStatus.Failed;
|
||||
await database.SaveChangesAsync(executeContext.CancellationToken);
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ namespace Musify.Infrastructure.MassTransit.Activities.PlayLists
|
||||
var playList = await database.PlayLists
|
||||
.SingleOrDefaultAsync(p => p.Id == executeContext.Arguments.PlayListId, executeContext.CancellationToken);
|
||||
|
||||
if (playList is null)
|
||||
if (playList == null)
|
||||
{
|
||||
logger.LogInformation(
|
||||
"PlayList {PlayListId} not found while marking as removing, skipping",
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ namespace Musify.Infrastructure.MassTransit.Activities.Tracks
|
||||
var track = await database.Tracks
|
||||
.SingleOrDefaultAsync(t => t.Id == executeContext.Arguments.TrackId, executeContext.CancellationToken);
|
||||
|
||||
if (track is null)
|
||||
if (track == null)
|
||||
{
|
||||
logger.LogInformation(
|
||||
"Track {TrackId} not found while deleting from DB, skipping",
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ namespace Musify.Infrastructure.MassTransit.Activities.Tracks
|
||||
var track = await database.Tracks
|
||||
.SingleOrDefaultAsync(t => t.Id == executeContext.Arguments.TrackId, executeContext.CancellationToken);
|
||||
|
||||
if (track is not null)
|
||||
if (track != null)
|
||||
{
|
||||
track.LifeCycleStatus = LifeCycleStatus.Failed;
|
||||
await database.SaveChangesAsync(executeContext.CancellationToken);
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ namespace Musify.Infrastructure.MassTransit.Activities.Tracks
|
||||
var track = await database.Tracks
|
||||
.SingleOrDefaultAsync(t => t.Id == executeContext.Arguments.TrackId, executeContext.CancellationToken);
|
||||
|
||||
if (track is null)
|
||||
if (track == null)
|
||||
{
|
||||
logger.LogInformation(
|
||||
"Track {TrackId} not found while marking as removing, skipping",
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ namespace Musify.Infrastructure.MassTransit.RoutingSlip.Builders
|
||||
EndpointHelper.BuildExecuteActivityUri(MarkPlayListAsRemovingActivity.ExecuteEndpointName),
|
||||
new MarkPlayListAsRemovingArguments(playListId));
|
||||
|
||||
if (playList?.Pictures is not null)
|
||||
if (playList?.Pictures != null)
|
||||
{
|
||||
var bucket = storageConfiguration.Bucket;
|
||||
var routes = playListConfiguration.Routes;
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ namespace Musify.Infrastructure.MassTransit.RoutingSlip.Builders
|
||||
EndpointHelper.BuildExecuteActivityUri(MarkTrackAsRemovingActivity.ExecuteEndpointName),
|
||||
new MarkTrackAsRemovingArguments(trackId));
|
||||
|
||||
if (track is not null)
|
||||
if (track != null)
|
||||
{
|
||||
var bucket = storageConfiguration.Bucket;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Musify.Infrastructure.Persistence
|
||||
|
||||
private static void ApplyTimestamps(DbContext? context)
|
||||
{
|
||||
if (context is null)
|
||||
if (context == null)
|
||||
return;
|
||||
|
||||
// SavingChanges(Async) fires before EF's own automatic change detection for this
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Musify.Infrastructure.Services
|
||||
if (duration <= TimeSpan.Zero)
|
||||
return await factory();
|
||||
|
||||
if (cache.TryGetValue(key, out TValue? cached) && cached is not null)
|
||||
if (cache.TryGetValue(key, out TValue? cached) && cached != null)
|
||||
return cached;
|
||||
|
||||
var pending = (Lazy<Task<ErrorOr<TValue>>>)inFlight.GetOrAdd(
|
||||
|
||||
@@ -276,7 +276,7 @@ namespace Musify.Infrastructure.Services
|
||||
{
|
||||
listResponse = await amazonS3.ListObjectsV2Async(listRequest, cancellationToken);
|
||||
|
||||
if (listResponse.S3Objects is null or { Count: 0 } )
|
||||
if (listResponse.S3Objects == null|| listResponse.S3Objects.Count == 0)
|
||||
break;
|
||||
|
||||
var deleteRequest = new DeleteObjectsRequest
|
||||
@@ -289,9 +289,6 @@ namespace Musify.Infrastructure.Services
|
||||
|
||||
var deleteResponse = await amazonS3.DeleteObjectsAsync(deleteRequest, cancellationToken);
|
||||
|
||||
// Some S3-compatible backends (SeaweedFS included) omit the <Error> list from the
|
||||
// XML response entirely when nothing failed, which the SDK deserializes as null
|
||||
// rather than an empty list — real AWS S3 always returns a (possibly empty) list.
|
||||
var deleteErrors = deleteResponse.DeleteErrors ?? [];
|
||||
if (deleteErrors.Count > 0)
|
||||
{
|
||||
|
||||
@@ -29,9 +29,9 @@ namespace Musify.Infrastructure.Services
|
||||
var now = DateTimeOffset.UtcNow;
|
||||
|
||||
var claims = new Dictionary<string, object> { ["prefix"] = keyPrefix };
|
||||
if (userId is not null)
|
||||
if (userId != null)
|
||||
claims["sub"] = userId.Value.ToString();
|
||||
if (maxBytes is not null)
|
||||
if (maxBytes != null)
|
||||
claims["maxBytes"] = maxBytes.Value.ToString();
|
||||
|
||||
var descriptor = new SecurityTokenDescriptor
|
||||
|
||||
Reference in New Issue
Block a user