From 7ce9a8371cd341b85c680b4c393ff6f6f709fd00 Mon Sep 17 00:00:00 2001 From: XShine555 Date: Fri, 20 Mar 2026 09:53:54 +0100 Subject: [PATCH] IEventBus --- .../CreatePlayList/CreatePlayListCommandHandler.cs | 4 ++-- .../DeletePlayList/DeletePlayListCommandHandler.cs | 10 +++++----- .../UpdatePlayList/UpdatePlayListCommandHandler.cs | 12 ++++++------ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Application/PlayLists/Commands/CreatePlayList/CreatePlayListCommandHandler.cs b/Application/PlayLists/Commands/CreatePlayList/CreatePlayListCommandHandler.cs index f57b028..793fd87 100644 --- a/Application/PlayLists/Commands/CreatePlayList/CreatePlayListCommandHandler.cs +++ b/Application/PlayLists/Commands/CreatePlayList/CreatePlayListCommandHandler.cs @@ -11,7 +11,7 @@ using Musify.Domain.Entities; namespace Musify.Application.PlayLists.Commands.CreatePlayList { - public class CreatePlayListCommandHandler(IPublishEndpoint publishEndpoint, IDatabase database, IStorageHandler storageHandler, + public class CreatePlayListCommandHandler(IEventBus eventBus, IDatabase database, IStorageHandler storageHandler, ILogger logger, StorageSettings storageConfiguration, PlayListConfiguration playListConfiguration) : IRequestHandler> > { @@ -61,7 +61,7 @@ namespace Musify.Application.PlayLists.Commands.CreatePlayList try { - await publishEndpoint.Publish(new ResizePictureEvent( + await eventBus.PublishAsync(new ResizePictureEvent( storageConfiguration.BucketName, originalImageStorageKey, [ diff --git a/Application/PlayLists/Commands/DeletePlayList/DeletePlayListCommandHandler.cs b/Application/PlayLists/Commands/DeletePlayList/DeletePlayListCommandHandler.cs index d980748..674a0fc 100644 --- a/Application/PlayLists/Commands/DeletePlayList/DeletePlayListCommandHandler.cs +++ b/Application/PlayLists/Commands/DeletePlayList/DeletePlayListCommandHandler.cs @@ -9,7 +9,7 @@ using Musify.Application.PlayLists; namespace Musify.Application.PlayLists.Commands.DeletePlayList { - public class DeletePlayListCommandHandler(IDatabase database, IPublishEndpoint publishEndpoint, + public class DeletePlayListCommandHandler(IDatabase database, IEventBus eventBus, StorageSettings storageConfiguration, PlayListConfiguration playListConfiguration, ILogger logger) : IRequestHandler> { @@ -35,7 +35,7 @@ namespace Musify.Application.PlayLists.Commands.DeletePlayList try { - await publishEndpoint.Publish(new RemoveFileEvent( + await eventBus.PublishAsync(new RemoveFileEvent( storageConfiguration.BucketName, originalImageStorageKey, Guid.NewGuid()), cancellationToken); @@ -50,7 +50,7 @@ namespace Musify.Application.PlayLists.Commands.DeletePlayList { try { - await publishEndpoint.Publish(new RemoveFileEvent( + await eventBus.PublishAsync(new RemoveFileEvent( storageConfiguration.BucketName, playList.SmallPictureKeyName, Guid.NewGuid()), cancellationToken); @@ -66,7 +66,7 @@ namespace Musify.Application.PlayLists.Commands.DeletePlayList { try { - await publishEndpoint.Publish(new RemoveFileEvent( + await eventBus.PublishAsync(new RemoveFileEvent( storageConfiguration.BucketName, playList.MediumPictureKeyName, Guid.NewGuid()), cancellationToken); @@ -82,7 +82,7 @@ namespace Musify.Application.PlayLists.Commands.DeletePlayList { try { - await publishEndpoint.Publish(new RemoveFileEvent( + await eventBus.PublishAsync(new RemoveFileEvent( storageConfiguration.BucketName, playList.LargePictureKeyName, Guid.NewGuid()), cancellationToken); diff --git a/Application/PlayLists/Commands/UpdatePlayList/UpdatePlayListCommandHandler.cs b/Application/PlayLists/Commands/UpdatePlayList/UpdatePlayListCommandHandler.cs index 52e4550..8d82457 100644 --- a/Application/PlayLists/Commands/UpdatePlayList/UpdatePlayListCommandHandler.cs +++ b/Application/PlayLists/Commands/UpdatePlayList/UpdatePlayListCommandHandler.cs @@ -10,7 +10,7 @@ using Musify.Application.PlayLists.Contracts; namespace Musify.Application.PlayLists.Commands.UpdatePlayList { - public class UpdatePlayListCommandHandler(IPublishEndpoint publishEndpoint, IDatabase database, IStorageHandler storageHandler, + public class UpdatePlayListCommandHandler(IEventBus eventBus, IDatabase database, IStorageHandler storageHandler, ILogger logger, StorageSettings storageConfiguration, PlayListConfiguration playListConfiguration) : IRequestHandler> > { @@ -53,7 +53,7 @@ namespace Musify.Application.PlayLists.Commands.UpdatePlayList try { - await publishEndpoint.Publish(new RemoveFileEvent( + await eventBus.PublishAsync(new RemoveFileEvent( storageConfiguration.BucketName, originalImageStorageKey, Guid.NewGuid()), cancellationToken); @@ -71,7 +71,7 @@ namespace Musify.Application.PlayLists.Commands.UpdatePlayList { try { - await publishEndpoint.Publish(new RemoveFileEvent( + await eventBus.PublishAsync(new RemoveFileEvent( storageConfiguration.BucketName, playList.SmallPictureKeyName, Guid.NewGuid()), cancellationToken); @@ -87,7 +87,7 @@ namespace Musify.Application.PlayLists.Commands.UpdatePlayList { try { - await publishEndpoint.Publish(new RemoveFileEvent( + await eventBus.PublishAsync(new RemoveFileEvent( storageConfiguration.BucketName, playList.MediumPictureKeyName, Guid.NewGuid()), cancellationToken); @@ -103,7 +103,7 @@ namespace Musify.Application.PlayLists.Commands.UpdatePlayList { try { - await publishEndpoint.Publish(new RemoveFileEvent( + await eventBus.PublishAsync(new RemoveFileEvent( storageConfiguration.BucketName, playList.LargePictureKeyName, Guid.NewGuid()), cancellationToken); @@ -138,7 +138,7 @@ namespace Musify.Application.PlayLists.Commands.UpdatePlayList try { - await publishEndpoint.Publish(new ResizePictureEvent( + await eventBus.PublishAsync(new ResizePictureEvent( storageConfiguration.BucketName, newImageStorageKey, [