IEventBus

This commit is contained in:
2026-03-20 09:53:54 +01:00
parent 1e1ea989e9
commit 7ce9a8371c
3 changed files with 13 additions and 13 deletions
@@ -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<CreatePlayListCommandHandler> logger, StorageSettings storageConfiguration, PlayListConfiguration playListConfiguration)
: IRequestHandler<CreatePlayListCommand, Task<Result<PlayListResponse>> >
{
@@ -61,7 +61,7 @@ namespace Musify.Application.PlayLists.Commands.CreatePlayList
try
{
await publishEndpoint.Publish(new ResizePictureEvent(
await eventBus.PublishAsync(new ResizePictureEvent(
storageConfiguration.BucketName,
originalImageStorageKey,
[
@@ -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<DeletePlayListCommandHandler> logger)
: IRequestHandler<DeletePlayListCommand, Task<Result>>
{
@@ -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);
@@ -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<UpdatePlayListCommandHandler> logger, StorageSettings storageConfiguration, PlayListConfiguration playListConfiguration)
: IRequestHandler<UpdatePlayListCommand, Task<Result<PlayListResponse>> >
{
@@ -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,
[