From 1a302491d18f02ccfc8e67fe2d584a3dcba781ac Mon Sep 17 00:00:00 2001 From: XShine555 Date: Thu, 24 Sep 2026 17:58:48 +0200 Subject: [PATCH] Changes --- backend/Core/Musify.Application/Albums/AddTracksToAlbum.cs | 2 -- backend/Core/Musify.Application/Albums/UpdateAlbum.cs | 1 - backend/Core/Musify.Application/Albums/UpdateAlbumPicture.cs | 1 - backend/Core/Musify.Application/Configuration/Pictures.cs | 1 - backend/Core/Musify.Application/Contracts/IStorageService.cs | 1 - backend/Core/Musify.Application/Likes/ToggleTrackLike.cs | 1 - backend/Core/Musify.Application/Pictures/GetCover.cs | 1 - .../Core/Musify.Application/Pictures/PictureSourceChange.cs | 1 - .../Core/Musify.Application/PlayLists/AddAlbumToPlayList.cs | 2 -- .../Core/Musify.Application/PlayLists/AddTracksToPlayList.cs | 2 -- backend/Core/Musify.Application/PlayLists/UpdatePlayList.cs | 1 - .../Musify.Application/PlayLists/UpdatePlayListPicture.cs | 1 - backend/Core/Musify.Application/Services/TrackStreamIssuer.cs | 1 - .../Core/Musify.Application/Services/UploadIntentIssuer.cs | 1 - backend/Core/Musify.Application/Shared/OwnershipExtensions.cs | 4 ---- backend/Core/Musify.Application/Shared/Pagination.cs | 1 - backend/Core/Musify.Application/Tracks/StartListening.cs | 1 - .../UploadIntents/DeleteStaleTempUploads.cs | 1 - .../Musify.Application/UploadIntents/ExpireUploadIntents.cs | 1 - backend/Core/Musify.Application/Users/FollowUser.cs | 1 - backend/Core/Musify.Domain/ValueObjects/EntityPictures.cs | 1 - backend/Core/Musify.Domain/ValueObjects/Genre.cs | 1 - .../Core/Musify.Infrastructure/Jobs/RecurringJobsRegistrar.cs | 2 -- .../MassTransit/Activities/Audio/TrackAudioStatus.cs | 1 - .../MassTransit/Activities/LifeCycle/LifeCycleActivities.cs | 4 ---- .../MassTransit/Activities/Pictures/UpdatePicturesActivity.cs | 2 -- .../MassTransit/Consumers/ProcessingFailedCleanup.cs | 1 - .../RoutingSlip/Builders/DeleteRoutingSlipBuilder.cs | 2 -- .../RoutingSlip/Builders/PictureSourceRoutingSlipBuilder.cs | 4 ---- .../RoutingSlip/Builders/PictureWorkflowRoutingSlipBuilder.cs | 1 - .../MassTransit/RoutingSlip/RoutingSlips.cs | 3 --- .../Musify.Infrastructure/Persistence/ModelConfiguration.cs | 3 --- backend/Hosts/Musify.Api/Models/GenreParameter.cs | 1 - backend/Hosts/Musify.Api/Models/PageQuery.cs | 2 -- backend/Hosts/Musify.Api/OpenApi/OpenApiOptionsSetup.cs | 3 --- .../MassTransit/ProcessingStateMachineTests.cs | 3 --- .../MassTransit/UpdatePicturesActivityTests.cs | 1 - 37 files changed, 61 deletions(-) diff --git a/backend/Core/Musify.Application/Albums/AddTracksToAlbum.cs b/backend/Core/Musify.Application/Albums/AddTracksToAlbum.cs index 455660e..286b447 100644 --- a/backend/Core/Musify.Application/Albums/AddTracksToAlbum.cs +++ b/backend/Core/Musify.Application/Albums/AddTracksToAlbum.cs @@ -9,7 +9,6 @@ using Musify.Domain.ValueObjects; namespace Musify.Application.Albums { - /// Appends your own tracks to an album in the given order, skipping the ones it already has. public record AddTracksToAlbumCommand(long UserId, Guid AlbumId, IReadOnlyList TrackIds) : ICommand>; @@ -50,7 +49,6 @@ namespace Musify.Application.Albums if (toAdd.Count == 0) return Result.Success; - // Album track numbers are user-visible, so they start at 1. var nextTrackNumber = (await database.AlbumHasTracks .Where(link => link.AlbumId == request.AlbumId) .MaxAsync(link => (int?)link.TrackNumber, cancellationToken) ?? 0) + 1; diff --git a/backend/Core/Musify.Application/Albums/UpdateAlbum.cs b/backend/Core/Musify.Application/Albums/UpdateAlbum.cs index 57635be..7fe2e7c 100644 --- a/backend/Core/Musify.Application/Albums/UpdateAlbum.cs +++ b/backend/Core/Musify.Application/Albums/UpdateAlbum.cs @@ -30,7 +30,6 @@ namespace Musify.Application.Albums var album = found.Value; var title = request.Title.Trim(); - // This is a full replace of the plain fields; the picture has its own command. album.Title = title; album.NormalizedTitle = TextNormalizer.Normalize(title); album.Description = string.IsNullOrWhiteSpace(request.Description) ? null : request.Description.Trim(); diff --git a/backend/Core/Musify.Application/Albums/UpdateAlbumPicture.cs b/backend/Core/Musify.Application/Albums/UpdateAlbumPicture.cs index 4e03faa..7633181 100644 --- a/backend/Core/Musify.Application/Albums/UpdateAlbumPicture.cs +++ b/backend/Core/Musify.Application/Albums/UpdateAlbumPicture.cs @@ -13,7 +13,6 @@ using Musify.Domain.ValueObjects; namespace Musify.Application.Albums { - /// Replaces an album's picture with a previously uploaded image; the plain fields are untouched. public record UpdateAlbumPictureCommand(long UserId, Guid AlbumId, Guid PictureIntentId) : ICommand>; diff --git a/backend/Core/Musify.Application/Configuration/Pictures.cs b/backend/Core/Musify.Application/Configuration/Pictures.cs index 08235a1..11d6868 100644 --- a/backend/Core/Musify.Application/Configuration/Pictures.cs +++ b/backend/Core/Musify.Application/Configuration/Pictures.cs @@ -83,7 +83,6 @@ namespace Musify.Application.Configuration public static class PictureSizeParser { - /// Parses the size query value; anything unknown means . public static PictureSize Parse(string? value) => Enum.TryParse(value, ignoreCase: true, out var size) && Enum.IsDefined(size) ? size diff --git a/backend/Core/Musify.Application/Contracts/IStorageService.cs b/backend/Core/Musify.Application/Contracts/IStorageService.cs index dfd37ab..4152808 100644 --- a/backend/Core/Musify.Application/Contracts/IStorageService.cs +++ b/backend/Core/Musify.Application/Contracts/IStorageService.cs @@ -2,7 +2,6 @@ namespace Musify.Application.Contracts { public interface IStorageService { - /// Opens an object for reading, or returns null when it does not exist. public Task GetFileAsync(string bucket, string key, CancellationToken cancellationToken); public Task HeadObjectAsync(string bucket, string key, CancellationToken cancellationToken); diff --git a/backend/Core/Musify.Application/Likes/ToggleTrackLike.cs b/backend/Core/Musify.Application/Likes/ToggleTrackLike.cs index 95e5978..c519ac8 100644 --- a/backend/Core/Musify.Application/Likes/ToggleTrackLike.cs +++ b/backend/Core/Musify.Application/Likes/ToggleTrackLike.cs @@ -44,7 +44,6 @@ namespace Musify.Application.Likes nowLiked = true; } - // A concurrent double click can hit the unique index; the outcome is already in place, so treat it as a no-op. var saved = await database.TrySaveChangesAsync( AppErrors.Conflict("TrackLike.Duplicate", "Track is already liked."), cancellationToken); if (saved.IsError) diff --git a/backend/Core/Musify.Application/Pictures/GetCover.cs b/backend/Core/Musify.Application/Pictures/GetCover.cs index 1e45cbc..7d04ee5 100644 --- a/backend/Core/Musify.Application/Pictures/GetCover.cs +++ b/backend/Core/Musify.Application/Pictures/GetCover.cs @@ -60,7 +60,6 @@ namespace Musify.Application.Pictures _ => source.Medium }; - // The resized files only exist once processing has finished; until then serve the original. var (name, key) = !string.IsNullOrEmpty(resizedName) ? (resizedName, routes.BuildPicturePath(request.Size, resizedName)) : !string.IsNullOrEmpty(source.Original) diff --git a/backend/Core/Musify.Application/Pictures/PictureSourceChange.cs b/backend/Core/Musify.Application/Pictures/PictureSourceChange.cs index 90df675..5ce0107 100644 --- a/backend/Core/Musify.Application/Pictures/PictureSourceChange.cs +++ b/backend/Core/Musify.Application/Pictures/PictureSourceChange.cs @@ -7,7 +7,6 @@ using Musify.Domain.ValueObjects; namespace Musify.Application.Pictures { - /// What an album or playlist needs to switch to a freshly uploaded picture. public sealed record PreparedPicture(UploadIntent Intent, EntityPictures Pictures, string FinalKey, ImageSizes Sizes); public static class PictureSourceChange diff --git a/backend/Core/Musify.Application/PlayLists/AddAlbumToPlayList.cs b/backend/Core/Musify.Application/PlayLists/AddAlbumToPlayList.cs index b8e1138..cf47936 100644 --- a/backend/Core/Musify.Application/PlayLists/AddAlbumToPlayList.cs +++ b/backend/Core/Musify.Application/PlayLists/AddAlbumToPlayList.cs @@ -11,7 +11,6 @@ using Musify.Domain.ValueObjects; namespace Musify.Application.PlayLists { - /// Appends every track of an album to a playlist in album order, skipping the ones it already has. public record AddAlbumToPlayListCommand(long UserId, Guid PlayListId, Guid AlbumId) : ICommand>; @@ -54,7 +53,6 @@ namespace Musify.Application.PlayLists if (newTrackIds.Count == 0) return new AddAlbumToPlayListResponse(0); - // Playlist positions are internal indexes, so they start at 0. var nextPosition = existingTrackIds.Count > 0 ? await playListTracksQuery.MaxAsync(link => link.Position, cancellationToken) + 1 : 0; diff --git a/backend/Core/Musify.Application/PlayLists/AddTracksToPlayList.cs b/backend/Core/Musify.Application/PlayLists/AddTracksToPlayList.cs index 1951026..fcc430b 100644 --- a/backend/Core/Musify.Application/PlayLists/AddTracksToPlayList.cs +++ b/backend/Core/Musify.Application/PlayLists/AddTracksToPlayList.cs @@ -9,7 +9,6 @@ using Musify.Domain.ValueObjects; namespace Musify.Application.PlayLists { - /// Appends tracks to a playlist in the given order, skipping the ones it already has. public record AddTracksToPlayListCommand(long UserId, Guid PlayListId, IReadOnlyList TrackIds) : ICommand>; @@ -46,7 +45,6 @@ namespace Musify.Application.PlayLists if (toAdd.Count == 0) return Result.Success; - // Playlist positions are internal indexes, so they start at 0. var playListTracksQuery = database.PlayListHasTracks .Where(link => link.PlayListId == request.PlayListId); diff --git a/backend/Core/Musify.Application/PlayLists/UpdatePlayList.cs b/backend/Core/Musify.Application/PlayLists/UpdatePlayList.cs index a69df77..c8177f6 100644 --- a/backend/Core/Musify.Application/PlayLists/UpdatePlayList.cs +++ b/backend/Core/Musify.Application/PlayLists/UpdatePlayList.cs @@ -30,7 +30,6 @@ namespace Musify.Application.PlayLists var playList = found.Value; - // This is a full replace of the plain fields; the picture has its own command. playList.Name = request.NewName.Trim(); playList.NormalizedName = TextNormalizer.Normalize(request.NewName); playList.Description = string.IsNullOrWhiteSpace(request.NewDescription) ? null : request.NewDescription.Trim(); diff --git a/backend/Core/Musify.Application/PlayLists/UpdatePlayListPicture.cs b/backend/Core/Musify.Application/PlayLists/UpdatePlayListPicture.cs index 273acf2..496eeab 100644 --- a/backend/Core/Musify.Application/PlayLists/UpdatePlayListPicture.cs +++ b/backend/Core/Musify.Application/PlayLists/UpdatePlayListPicture.cs @@ -13,7 +13,6 @@ using Musify.Domain.ValueObjects; namespace Musify.Application.PlayLists { - /// Replaces a playlist's picture with a previously uploaded image; the plain fields are untouched. public record UpdatePlayListPictureCommand(long UserId, Guid PlayListId, Guid PictureIntentId) : ICommand>; diff --git a/backend/Core/Musify.Application/Services/TrackStreamIssuer.cs b/backend/Core/Musify.Application/Services/TrackStreamIssuer.cs index fb50164..2dc61e7 100644 --- a/backend/Core/Musify.Application/Services/TrackStreamIssuer.cs +++ b/backend/Core/Musify.Application/Services/TrackStreamIssuer.cs @@ -4,7 +4,6 @@ using Musify.Application.Tracks.Responses; namespace Musify.Application.Services { - /// Builds the stream URL and signed ticket for a processed track. It never touches the database. public sealed class TrackStreamIssuer( IStreamTicketService ticketService, TrackConfiguration trackConfiguration, diff --git a/backend/Core/Musify.Application/Services/UploadIntentIssuer.cs b/backend/Core/Musify.Application/Services/UploadIntentIssuer.cs index 1e36869..840a5c6 100644 --- a/backend/Core/Musify.Application/Services/UploadIntentIssuer.cs +++ b/backend/Core/Musify.Application/Services/UploadIntentIssuer.cs @@ -24,7 +24,6 @@ namespace Musify.Application.Services string ContentType, string UploadUrl); - /// Issues pre-signed upload URLs and the upload intents that track them, checking the user quota first. public sealed class UploadIntentIssuer( IDatabase database, IStorageService storageService, diff --git a/backend/Core/Musify.Application/Shared/OwnershipExtensions.cs b/backend/Core/Musify.Application/Shared/OwnershipExtensions.cs index af06273..0952c4a 100644 --- a/backend/Core/Musify.Application/Shared/OwnershipExtensions.cs +++ b/backend/Core/Musify.Application/Shared/OwnershipExtensions.cs @@ -7,10 +7,6 @@ namespace Musify.Application.Shared { public static class OwnershipExtensions { - /// - /// Loads an active, tracked entity owned by : NotFound when it is missing - /// or not active, Forbidden when someone else owns it. - /// public static async Task> FindOwnedAsync( this DbSet set, Guid id, long userId, CancellationToken cancellationToken) where T : class, IOwnedEntity, IHasLifeCycle diff --git a/backend/Core/Musify.Application/Shared/Pagination.cs b/backend/Core/Musify.Application/Shared/Pagination.cs index a58addf..f551fd2 100644 --- a/backend/Core/Musify.Application/Shared/Pagination.cs +++ b/backend/Core/Musify.Application/Shared/Pagination.cs @@ -18,7 +18,6 @@ namespace Musify.Application.Shared public static class PaginationExtensions { - /// Counts and pages the same (already filtered, ordered and projected) query. public static async Task> ToPaginatedAsync( this IQueryable query, PageRequest page, CancellationToken cancellationToken) { diff --git a/backend/Core/Musify.Application/Tracks/StartListening.cs b/backend/Core/Musify.Application/Tracks/StartListening.cs index 73a51c7..b49b344 100644 --- a/backend/Core/Musify.Application/Tracks/StartListening.cs +++ b/backend/Core/Musify.Application/Tracks/StartListening.cs @@ -13,7 +13,6 @@ using Musify.Domain.ValueObjects; namespace Musify.Application.Tracks { - /// Starts a listen: records it for signed-in users and issues the stream ticket. public record StartListeningCommand(Guid TrackId, long? UserId) : ICommand>; diff --git a/backend/Core/Musify.Application/UploadIntents/DeleteStaleTempUploads.cs b/backend/Core/Musify.Application/UploadIntents/DeleteStaleTempUploads.cs index a27baa6..d99e941 100644 --- a/backend/Core/Musify.Application/UploadIntents/DeleteStaleTempUploads.cs +++ b/backend/Core/Musify.Application/UploadIntents/DeleteStaleTempUploads.cs @@ -5,7 +5,6 @@ using Musify.Application.Contracts; namespace Musify.Application.UploadIntents { - /// Deletes temporary upload objects that nobody claimed within the retention window. public record DeleteStaleTempUploadsCommand : ICommand; public class DeleteStaleTempUploadsCommandHandler( diff --git a/backend/Core/Musify.Application/UploadIntents/ExpireUploadIntents.cs b/backend/Core/Musify.Application/UploadIntents/ExpireUploadIntents.cs index 1759bfd..30a2297 100644 --- a/backend/Core/Musify.Application/UploadIntents/ExpireUploadIntents.cs +++ b/backend/Core/Musify.Application/UploadIntents/ExpireUploadIntents.cs @@ -7,7 +7,6 @@ using Musify.Domain.ValueObjects; namespace Musify.Application.UploadIntents { - /// Marks overdue upload intents as expired and deletes the ones expired for longer than the retention window. public record ExpireUploadIntentsCommand : ICommand; public class ExpireUploadIntentsCommandHandler( diff --git a/backend/Core/Musify.Application/Users/FollowUser.cs b/backend/Core/Musify.Application/Users/FollowUser.cs index 029b2ee..a275e38 100644 --- a/backend/Core/Musify.Application/Users/FollowUser.cs +++ b/backend/Core/Musify.Application/Users/FollowUser.cs @@ -38,7 +38,6 @@ namespace Musify.Application.Users FollowedId = request.FollowedId }, cancellationToken); - // A concurrent double click can hit the unique index; already following is a successful no-op. var saved = await database.TrySaveChangesAsync( AppErrors.Conflict("UserFollow.Duplicate", "Already following this user."), cancellationToken); if (saved.IsError) diff --git a/backend/Core/Musify.Domain/ValueObjects/EntityPictures.cs b/backend/Core/Musify.Domain/ValueObjects/EntityPictures.cs index bc6e091..c8f04b7 100644 --- a/backend/Core/Musify.Domain/ValueObjects/EntityPictures.cs +++ b/backend/Core/Musify.Domain/ValueObjects/EntityPictures.cs @@ -2,7 +2,6 @@ using System.ComponentModel.DataAnnotations; namespace Musify.Domain.ValueObjects { - /// The picture file names of an album or playlist. Resized names stay null until processing finishes. public class EntityPictures { [Required] diff --git a/backend/Core/Musify.Domain/ValueObjects/Genre.cs b/backend/Core/Musify.Domain/ValueObjects/Genre.cs index f8e78dc..e04e5eb 100644 --- a/backend/Core/Musify.Domain/ValueObjects/Genre.cs +++ b/backend/Core/Musify.Domain/ValueObjects/Genre.cs @@ -2,7 +2,6 @@ namespace Musify.Domain.ValueObjects { public enum Genre { - /// Unset value (the enum default); it is not a real genre and is never stored or offered to clients. None = 0, Pop = 1, Rock = 2, diff --git a/backend/Core/Musify.Infrastructure/Jobs/RecurringJobsRegistrar.cs b/backend/Core/Musify.Infrastructure/Jobs/RecurringJobsRegistrar.cs index a2f154b..8311156 100644 --- a/backend/Core/Musify.Infrastructure/Jobs/RecurringJobsRegistrar.cs +++ b/backend/Core/Musify.Infrastructure/Jobs/RecurringJobsRegistrar.cs @@ -4,7 +4,6 @@ using Musify.Application.Configuration; namespace Musify.Infrastructure.Jobs { - /// Registers every recurring Hangfire job when the host starts. public sealed class RecurringJobsRegistrar( IRecurringJobManager recurringJobManager, UploadIntentConfiguration uploadIntentConfiguration) @@ -30,7 +29,6 @@ namespace Musify.Infrastructure.Jobs public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask; - /// Hangfire cron has a one-minute resolution, so the interval is rounded up to whole minutes. internal static string EveryCron(int intervalSeconds) { var minutes = Math.Max(1, (int)Math.Ceiling(intervalSeconds / 60.0)); diff --git a/backend/Core/Musify.Infrastructure/MassTransit/Activities/Audio/TrackAudioStatus.cs b/backend/Core/Musify.Infrastructure/MassTransit/Activities/Audio/TrackAudioStatus.cs index ba69169..e2ad340 100644 --- a/backend/Core/Musify.Infrastructure/MassTransit/Activities/Audio/TrackAudioStatus.cs +++ b/backend/Core/Musify.Infrastructure/MassTransit/Activities/Audio/TrackAudioStatus.cs @@ -5,7 +5,6 @@ using Musify.Domain.ValueObjects; namespace Musify.Infrastructure.MassTransit.Activities.Audio { - /// Shared bookkeeping of the audio processing activities. internal static class TrackAudioStatus { public static async Task LoadAsync(IDatabase database, Guid trackId, CancellationToken cancellationToken) => diff --git a/backend/Core/Musify.Infrastructure/MassTransit/Activities/LifeCycle/LifeCycleActivities.cs b/backend/Core/Musify.Infrastructure/MassTransit/Activities/LifeCycle/LifeCycleActivities.cs index 52bab3e..e838eb8 100644 --- a/backend/Core/Musify.Infrastructure/MassTransit/Activities/LifeCycle/LifeCycleActivities.cs +++ b/backend/Core/Musify.Infrastructure/MassTransit/Activities/LifeCycle/LifeCycleActivities.cs @@ -8,7 +8,6 @@ using Musify.Infrastructure.MassTransit.Arguments; namespace Musify.Infrastructure.MassTransit.Activities.LifeCycle { - /// Sets the life-cycle status of an entity (removing, failed, ...). A missing entity is skipped. internal abstract class MarkLifeCycleActivity(IDatabase database, ILogger logger) : IExecuteActivity where TEntity : class, IHasLifeCycle @@ -33,7 +32,6 @@ namespace Musify.Infrastructure.MassTransit.Activities.LifeCycle } } - /// Deletes an entity row. A missing entity is skipped. internal abstract class DeleteEntityActivity(IDatabase database, ILogger logger) : IExecuteActivity where TEntity : class, IHasLifeCycle @@ -58,8 +56,6 @@ namespace Musify.Infrastructure.MassTransit.Activities.LifeCycle } } - // One concrete activity per entity keeps a separate queue for each of them: - // the endpoint name is the kebab-cased class name. internal sealed class MarkTrackLifeCycleActivity(IDatabase database, ILogger logger) : MarkLifeCycleActivity(database, logger) { diff --git a/backend/Core/Musify.Infrastructure/MassTransit/Activities/Pictures/UpdatePicturesActivity.cs b/backend/Core/Musify.Infrastructure/MassTransit/Activities/Pictures/UpdatePicturesActivity.cs index 3536d55..88108ac 100644 --- a/backend/Core/Musify.Infrastructure/MassTransit/Activities/Pictures/UpdatePicturesActivity.cs +++ b/backend/Core/Musify.Infrastructure/MassTransit/Activities/Pictures/UpdatePicturesActivity.cs @@ -12,7 +12,6 @@ namespace Musify.Infrastructure.MassTransit.Activities.Pictures { internal sealed record PictureNames(string? Original, string? Small, string? Medium, string? Large); - /// Stores the processed picture names on the owner and reports it; compensation restores the previous names. internal abstract class UpdatePicturesActivity( IDatabase database, IPublishEndpoint publishEndpoint, @@ -24,7 +23,6 @@ namespace Musify.Infrastructure.MassTransit.Activities.Pictures protected abstract Task FindAsync(Guid id, CancellationToken cancellationToken); - /// Reads the current names; throws when the entity has no pending picture. protected abstract PictureNames Read(TEntity entity); protected abstract void Write(TEntity entity, PictureNames names, bool succeeded); diff --git a/backend/Core/Musify.Infrastructure/MassTransit/Consumers/ProcessingFailedCleanup.cs b/backend/Core/Musify.Infrastructure/MassTransit/Consumers/ProcessingFailedCleanup.cs index e717b55..067a2a3 100644 --- a/backend/Core/Musify.Infrastructure/MassTransit/Consumers/ProcessingFailedCleanup.cs +++ b/backend/Core/Musify.Infrastructure/MassTransit/Consumers/ProcessingFailedCleanup.cs @@ -7,7 +7,6 @@ namespace Musify.Infrastructure.MassTransit.Consumers { internal static class ProcessingFailedCleanup { - /// Removes whatever files were left behind and marks the entity as failed. public static Task ExecuteAsync( IBus bus, Guid subjectId, diff --git a/backend/Core/Musify.Infrastructure/MassTransit/RoutingSlip/Builders/DeleteRoutingSlipBuilder.cs b/backend/Core/Musify.Infrastructure/MassTransit/RoutingSlip/Builders/DeleteRoutingSlipBuilder.cs index 6e5f6e3..da99504 100644 --- a/backend/Core/Musify.Infrastructure/MassTransit/RoutingSlip/Builders/DeleteRoutingSlipBuilder.cs +++ b/backend/Core/Musify.Infrastructure/MassTransit/RoutingSlip/Builders/DeleteRoutingSlipBuilder.cs @@ -8,7 +8,6 @@ using Musify.Infrastructure.MassTransit.Arguments; namespace Musify.Infrastructure.MassTransit.RoutingSlip.Builders { - /// Marks an entity as removing, deletes its files from the bucket and finally deletes its row. public class DeleteRoutingSlipBuilder( IDatabase database, TrackConfiguration trackConfiguration, @@ -48,7 +47,6 @@ namespace Musify.Infrastructure.MassTransit.RoutingSlip.Builders routes.BuildOriginalPicturePath(userId, track.Pictures.OriginalName)); } - // Unprocessed tracks still point at the shared preset pictures, which must never be deleted. if (track.Pictures.IsProcessed) { builder.AddRemoveFile(ActivityNames.RemoveTrackSmallPicture, bucket, routes.BuildPicturePath(PictureSize.Small, track.Pictures.SmallName)); diff --git a/backend/Core/Musify.Infrastructure/MassTransit/RoutingSlip/Builders/PictureSourceRoutingSlipBuilder.cs b/backend/Core/Musify.Infrastructure/MassTransit/RoutingSlip/Builders/PictureSourceRoutingSlipBuilder.cs index 6395130..79e3995 100644 --- a/backend/Core/Musify.Infrastructure/MassTransit/RoutingSlip/Builders/PictureSourceRoutingSlipBuilder.cs +++ b/backend/Core/Musify.Infrastructure/MassTransit/RoutingSlip/Builders/PictureSourceRoutingSlipBuilder.cs @@ -8,10 +8,6 @@ using Musify.Infrastructure.MassTransit.Arguments; namespace Musify.Infrastructure.MassTransit.RoutingSlip.Builders { - /// - /// Moves an uploaded album/playlist picture to its final key, consumes the upload intent and hands over to the picture workflow. - /// Creation faults mark the whole entity as failed; update faults only report the picture as failed. - /// public class PictureSourceRoutingSlipBuilder { public RoutingSlipBuilder Build(CreateAlbumResourcesEvent message, Guid? correlationId) => diff --git a/backend/Core/Musify.Infrastructure/MassTransit/RoutingSlip/Builders/PictureWorkflowRoutingSlipBuilder.cs b/backend/Core/Musify.Infrastructure/MassTransit/RoutingSlip/Builders/PictureWorkflowRoutingSlipBuilder.cs index 07cfcda..d8be77b 100644 --- a/backend/Core/Musify.Infrastructure/MassTransit/RoutingSlip/Builders/PictureWorkflowRoutingSlipBuilder.cs +++ b/backend/Core/Musify.Infrastructure/MassTransit/RoutingSlip/Builders/PictureWorkflowRoutingSlipBuilder.cs @@ -8,7 +8,6 @@ using Musify.Infrastructure.MassTransit.Arguments; namespace Musify.Infrastructure.MassTransit.RoutingSlip.Builders { - /// Downloads a picture, resizes it to the three sizes, uploads them and records the result on the owner. public class PictureWorkflowRoutingSlipBuilder(WorkerConfiguration workerConfiguration) { public RoutingSlipBuilder Build(UpdateTrackPictureEvent message, Guid? correlationId) => diff --git a/backend/Core/Musify.Infrastructure/MassTransit/RoutingSlip/RoutingSlips.cs b/backend/Core/Musify.Infrastructure/MassTransit/RoutingSlip/RoutingSlips.cs index b9cd391..08feb0f 100644 --- a/backend/Core/Musify.Infrastructure/MassTransit/RoutingSlip/RoutingSlips.cs +++ b/backend/Core/Musify.Infrastructure/MassTransit/RoutingSlip/RoutingSlips.cs @@ -6,14 +6,12 @@ using Musify.Infrastructure.MassTransit.Consumers; namespace Musify.Infrastructure.MassTransit.RoutingSlip { - /// Shared building blocks for every routing slip in the worker. internal static class RoutingSlips { public static Uri ExecuteUri(string endpointName) => new($"queue:{endpointName}_execute"); public static Uri ConsumerUri(string queueName) => new($"queue:{queueName}"); - /// A new slip that carries the correlation id and always cleans its temporary directory up. public static RoutingSlipBuilder Create(Guid? correlationId) { var builder = new RoutingSlipBuilder(NewId.NextGuid()); @@ -32,7 +30,6 @@ namespace Musify.Infrastructure.MassTransit.RoutingSlip return builder; } - /// Publishes a failure event for the subject when the slip faults. public static RoutingSlipBuilder TrackFaults( this RoutingSlipBuilder builder, Guid subjectId, string processKind) { diff --git a/backend/Core/Musify.Infrastructure/Persistence/ModelConfiguration.cs b/backend/Core/Musify.Infrastructure/Persistence/ModelConfiguration.cs index dfeac50..4e20f7d 100644 --- a/backend/Core/Musify.Infrastructure/Persistence/ModelConfiguration.cs +++ b/backend/Core/Musify.Infrastructure/Persistence/ModelConfiguration.cs @@ -5,9 +5,6 @@ using Musify.Infrastructure.MassTransit.Sagas; namespace Musify.Infrastructure.Persistence { - /// - /// Entity model shared by and the in-memory test database, so both always agree. - /// public static class ModelConfiguration { public static void Apply(ModelBuilder modelBuilder) diff --git a/backend/Hosts/Musify.Api/Models/GenreParameter.cs b/backend/Hosts/Musify.Api/Models/GenreParameter.cs index d3dfa22..68dd6c5 100644 --- a/backend/Hosts/Musify.Api/Models/GenreParameter.cs +++ b/backend/Hosts/Musify.Api/Models/GenreParameter.cs @@ -2,7 +2,6 @@ using Musify.Domain.ValueObjects; namespace Musify.Api.Models { - /// Query-string binding for a genre name (case-insensitive); unknown names are rejected with a 400. public readonly record struct GenreParameter(Genre Value) { public static bool TryParse(string? value, out GenreParameter result) diff --git a/backend/Hosts/Musify.Api/Models/PageQuery.cs b/backend/Hosts/Musify.Api/Models/PageQuery.cs index 2c21750..e7850cb 100644 --- a/backend/Hosts/Musify.Api/Models/PageQuery.cs +++ b/backend/Hosts/Musify.Api/Models/PageQuery.cs @@ -1,9 +1,7 @@ using Microsoft.AspNetCore.Mvc; -using Musify.Application.Shared; namespace Musify.Api.Models { - /// Query-string binding for , keeping the camelCase parameter names of the API. public record PageQuery( [property: FromQuery(Name = "pageNumber")] int PageNumber = 1, [property: FromQuery(Name = "pageSize")] int PageSize = 20); diff --git a/backend/Hosts/Musify.Api/OpenApi/OpenApiOptionsSetup.cs b/backend/Hosts/Musify.Api/OpenApi/OpenApiOptionsSetup.cs index acc2c72..3dae914 100644 --- a/backend/Hosts/Musify.Api/OpenApi/OpenApiOptionsSetup.cs +++ b/backend/Hosts/Musify.Api/OpenApi/OpenApiOptionsSetup.cs @@ -40,8 +40,6 @@ namespace Musify.Api.OpenApi options.AddSchemaTransformer((schema, context, _) => { - // Every long the API returns is a user id, serialized as a string (JS loses precision above 2^53). - // Request DTOs only carry byte sizes, which may be sent as numbers or strings. if (context.JsonPropertyInfo is { } property && (property.PropertyType == typeof(long) || property.PropertyType == typeof(long?))) { @@ -57,7 +55,6 @@ namespace Musify.Api.OpenApi options.AddOperationTransformer((operation, context, _) => { - // Route parameters constrained with :long are user ids, which travel as strings like every other long. foreach (var parameter in operation.Parameters?.OfType() ?? []) { if (parameter.Schema is OpenApiSchema { Type: JsonSchemaType.Integer, Format: "int64" } schema) diff --git a/backend/Tests/Musify.Infrastructure.Tests/MassTransit/ProcessingStateMachineTests.cs b/backend/Tests/Musify.Infrastructure.Tests/MassTransit/ProcessingStateMachineTests.cs index 25ff4f9..4c2bd7e 100644 --- a/backend/Tests/Musify.Infrastructure.Tests/MassTransit/ProcessingStateMachineTests.cs +++ b/backend/Tests/Musify.Infrastructure.Tests/MassTransit/ProcessingStateMachineTests.cs @@ -14,7 +14,6 @@ namespace Musify.Infrastructure.Tests.MassTransit private static CancellationToken Ct => TestContext.Current.CancellationToken; - // Track [Fact] public async Task Track_PictureAndAudioProcessed_CompletesTheSaga() @@ -86,7 +85,6 @@ namespace Musify.Infrastructure.Tests.MassTransit Assert.False(await harness.Published.Any(Ct)); } - // Album [Fact] public async Task Album_PictureProcessed_CompletesTheSaga() @@ -137,7 +135,6 @@ namespace Musify.Infrastructure.Tests.MassTransit Assert.False(await harness.Published.Any>(Ct)); } - // PlayList [Fact] public async Task PlayList_PictureProcessed_CompletesTheSaga() diff --git a/backend/Tests/Musify.Infrastructure.Tests/MassTransit/UpdatePicturesActivityTests.cs b/backend/Tests/Musify.Infrastructure.Tests/MassTransit/UpdatePicturesActivityTests.cs index 0f85942..20dfac4 100644 --- a/backend/Tests/Musify.Infrastructure.Tests/MassTransit/UpdatePicturesActivityTests.cs +++ b/backend/Tests/Musify.Infrastructure.Tests/MassTransit/UpdatePicturesActivityTests.cs @@ -16,7 +16,6 @@ using Xunit; namespace Musify.Infrastructure.Tests.MassTransit { - /// Runs the picture-update activities inside real routing slips on the MassTransit test harness. [Collection(InfrastructureCollection.Name)] public sealed class UpdatePicturesActivityTests(InfrastructureTestFixture fixture) {