Skip to content

Commit

Permalink
Simpifying MediaThemeDeploymentSource
Browse files Browse the repository at this point in the history
  • Loading branch information
Piedone committed Nov 28, 2024
1 parent 67b7f2b commit dcfa5bd
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,21 @@

namespace Lombiq.Hosting.MediaTheme.Bridge.Deployment;

public class MediaThemeDeploymentSource : IDeploymentSource
public class MediaThemeDeploymentSource : DeploymentSourceBase<MediaThemeDeploymentStep>
{
private readonly IMediaThemeStateStore _mediaThemeStateStore;

public MediaThemeDeploymentSource(IMediaThemeStateStore mediaThemeStateStore) =>
_mediaThemeStateStore = mediaThemeStateStore;

public async Task ProcessDeploymentStepAsync(DeploymentStep step, DeploymentPlanResult result)
protected override async Task ProcessAsync(MediaThemeDeploymentStep step, DeploymentPlanResult result)
{
if (step is not MediaThemeDeploymentStep mediaThemeStep)
{
return;
}

var mediaThemeState = await _mediaThemeStateStore.GetMediaThemeStateAsync();

result.Steps.Add(new JsonObject(new Dictionary<string, JsonNode>
{
["name"] = RecipeStepIds.MediaTheme,
[nameof(MediaThemeDeploymentStep.ClearMediaThemeFolder)] = mediaThemeStep.ClearMediaThemeFolder,
[nameof(MediaThemeDeploymentStep.ClearMediaThemeFolder)] = step.ClearMediaThemeFolder,
[nameof(MediaThemeStateDocument.BaseThemeId)] = mediaThemeState.BaseThemeId,
}));
}
Expand Down

0 comments on commit dcfa5bd

Please sign in to comment.