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