Changes on packages

This commit is contained in:
2026-09-20 16:23:49 +02:00
parent 3f5e01f910
commit 4251d292e1
54 changed files with 68 additions and 66 deletions
@@ -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)