Changes
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
namespace Musify.Application.Contracts.Application
|
||||
{
|
||||
public interface IEvent
|
||||
{
|
||||
Guid JobId { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
namespace Musify.Application.Events
|
||||
using Musify.Application.Contracts.Application;
|
||||
|
||||
namespace Musify.Application.Events
|
||||
{
|
||||
public record RemoveFileEvent(
|
||||
Guid JobId,
|
||||
string BucketName,
|
||||
string KeyName,
|
||||
Guid JobId);
|
||||
string KeyName) : IEvent;
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
namespace Musify.Application.Events
|
||||
using Musify.Application.Contracts.Application;
|
||||
|
||||
namespace Musify.Application.Events
|
||||
{
|
||||
public record ResizePictureEvent(
|
||||
Guid JobId,
|
||||
string BucketName,
|
||||
string KeyName,
|
||||
ResizePictureItems[] Items,
|
||||
Guid JobId);
|
||||
ResizePictureItems[] Items) : IEvent;
|
||||
}
|
||||
@@ -61,6 +61,7 @@ namespace Musify.Application.PlayLists.Commands.CreatePlayList
|
||||
try
|
||||
{
|
||||
await eventBus.PublishAsync(new ResizePictureEvent(
|
||||
Guid.NewGuid(),
|
||||
storageConfiguration.BucketName,
|
||||
originalImageStorageKey,
|
||||
[
|
||||
@@ -76,8 +77,7 @@ namespace Musify.Application.PlayLists.Commands.CreatePlayList
|
||||
playListConfiguration.PicturesSizes.LargePictureWidth,
|
||||
playListConfiguration.PicturesSizes.LargePictureHeight,
|
||||
playListConfiguration.Routes.LargePictures)
|
||||
],
|
||||
Guid.NewGuid()), cancellationToken);
|
||||
] ), cancellationToken);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
|
||||
@@ -36,9 +36,9 @@ namespace Musify.Application.PlayLists.Commands.DeletePlayList
|
||||
try
|
||||
{
|
||||
await eventBus.PublishAsync(new RemoveFileEvent(
|
||||
Guid.NewGuid(),
|
||||
storageConfiguration.BucketName,
|
||||
originalImageStorageKey,
|
||||
Guid.NewGuid()), cancellationToken);
|
||||
originalImageStorageKey), cancellationToken);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
@@ -51,9 +51,9 @@ namespace Musify.Application.PlayLists.Commands.DeletePlayList
|
||||
try
|
||||
{
|
||||
await eventBus.PublishAsync(new RemoveFileEvent(
|
||||
Guid.NewGuid(),
|
||||
storageConfiguration.BucketName,
|
||||
playList.SmallPictureKeyName,
|
||||
Guid.NewGuid()), cancellationToken);
|
||||
playList.SmallPictureKeyName), cancellationToken);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
@@ -67,9 +67,9 @@ namespace Musify.Application.PlayLists.Commands.DeletePlayList
|
||||
try
|
||||
{
|
||||
await eventBus.PublishAsync(new RemoveFileEvent(
|
||||
Guid.NewGuid(),
|
||||
storageConfiguration.BucketName,
|
||||
playList.MediumPictureKeyName,
|
||||
Guid.NewGuid()), cancellationToken);
|
||||
playList.MediumPictureKeyName), cancellationToken);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
@@ -83,9 +83,9 @@ namespace Musify.Application.PlayLists.Commands.DeletePlayList
|
||||
try
|
||||
{
|
||||
await eventBus.PublishAsync(new RemoveFileEvent(
|
||||
Guid.NewGuid(),
|
||||
storageConfiguration.BucketName,
|
||||
playList.LargePictureKeyName,
|
||||
Guid.NewGuid()), cancellationToken);
|
||||
playList.LargePictureKeyName), cancellationToken);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
|
||||
@@ -54,9 +54,9 @@ namespace Musify.Application.PlayLists.Commands.UpdatePlayList
|
||||
try
|
||||
{
|
||||
await eventBus.PublishAsync(new RemoveFileEvent(
|
||||
Guid.NewGuid(),
|
||||
storageConfiguration.BucketName,
|
||||
originalImageStorageKey,
|
||||
Guid.NewGuid()), cancellationToken);
|
||||
originalImageStorageKey), cancellationToken);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
@@ -72,9 +72,9 @@ namespace Musify.Application.PlayLists.Commands.UpdatePlayList
|
||||
try
|
||||
{
|
||||
await eventBus.PublishAsync(new RemoveFileEvent(
|
||||
Guid.NewGuid(),
|
||||
storageConfiguration.BucketName,
|
||||
playList.SmallPictureKeyName,
|
||||
Guid.NewGuid()), cancellationToken);
|
||||
playList.SmallPictureKeyName), cancellationToken);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
@@ -88,9 +88,9 @@ namespace Musify.Application.PlayLists.Commands.UpdatePlayList
|
||||
try
|
||||
{
|
||||
await eventBus.PublishAsync(new RemoveFileEvent(
|
||||
Guid.NewGuid(),
|
||||
storageConfiguration.BucketName,
|
||||
playList.MediumPictureKeyName,
|
||||
Guid.NewGuid()), cancellationToken);
|
||||
playList.MediumPictureKeyName), cancellationToken);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
@@ -104,9 +104,9 @@ namespace Musify.Application.PlayLists.Commands.UpdatePlayList
|
||||
try
|
||||
{
|
||||
await eventBus.PublishAsync(new RemoveFileEvent(
|
||||
Guid.NewGuid(),
|
||||
storageConfiguration.BucketName,
|
||||
playList.LargePictureKeyName,
|
||||
Guid.NewGuid()), cancellationToken);
|
||||
playList.LargePictureKeyName), cancellationToken);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
@@ -139,6 +139,7 @@ namespace Musify.Application.PlayLists.Commands.UpdatePlayList
|
||||
try
|
||||
{
|
||||
await eventBus.PublishAsync(new ResizePictureEvent(
|
||||
Guid.NewGuid(),
|
||||
storageConfiguration.BucketName,
|
||||
newImageStorageKey,
|
||||
[
|
||||
@@ -154,8 +155,7 @@ namespace Musify.Application.PlayLists.Commands.UpdatePlayList
|
||||
playListConfiguration.PicturesSizes.LargePictureWidth,
|
||||
playListConfiguration.PicturesSizes.LargePictureHeight,
|
||||
playListConfiguration.Routes.LargePictures)
|
||||
],
|
||||
Guid.NewGuid()
|
||||
]
|
||||
), cancellationToken);
|
||||
}
|
||||
catch (Exception exception)
|
||||
|
||||
Reference in New Issue
Block a user