From 94daa54996c80e6e57c8eec9cfe54ac83f576759 Mon Sep 17 00:00:00 2001 From: Robert Dailey Date: Sun, 28 Jul 2024 16:26:28 -0500 Subject: [PATCH] refactor: Better pipeline execusion debug logs --- .../Pipelines/CustomFormat/CustomFormatPipelineContext.cs | 2 +- src/Recyclarr.Cli/Pipelines/Generic/GenericSyncPipeline.cs | 6 ++++-- .../Pipelines/MediaNaming/MediaNamingPipelineContext.cs | 2 +- .../QualityProfile/QualityProfilePipelineContext.cs | 2 +- .../Pipelines/QualitySize/QualitySizePipelineContext.cs | 2 +- src/Recyclarr.Cli/Processors/Sync/SyncPipelineExecutor.cs | 1 - 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Recyclarr.Cli/Pipelines/CustomFormat/CustomFormatPipelineContext.cs b/src/Recyclarr.Cli/Pipelines/CustomFormat/CustomFormatPipelineContext.cs index 7d388d8a..e93ae6fc 100644 --- a/src/Recyclarr.Cli/Pipelines/CustomFormat/CustomFormatPipelineContext.cs +++ b/src/Recyclarr.Cli/Pipelines/CustomFormat/CustomFormatPipelineContext.cs @@ -8,7 +8,7 @@ namespace Recyclarr.Cli.Pipelines.CustomFormat; public class CustomFormatPipelineContext : IPipelineContext { - public string PipelineDescription => "Custom Format Pipeline"; + public string PipelineDescription => "Custom Format"; public IReadOnlyCollection SupportedServiceTypes { get; } = new[] { SupportedServices.Sonarr, diff --git a/src/Recyclarr.Cli/Pipelines/Generic/GenericSyncPipeline.cs b/src/Recyclarr.Cli/Pipelines/Generic/GenericSyncPipeline.cs index 70c88f4b..44fabea5 100644 --- a/src/Recyclarr.Cli/Pipelines/Generic/GenericSyncPipeline.cs +++ b/src/Recyclarr.Cli/Pipelines/Generic/GenericSyncPipeline.cs @@ -13,10 +13,12 @@ public class GenericSyncPipeline( public async Task Execute(ISyncSettings settings, CancellationToken ct) { var context = new TContext(); + + log.Debug("Executing Pipeline: {Pipeline}", context.PipelineDescription); + if (!context.SupportedServiceTypes.Contains(config.ServiceType)) { - log.Debug("Skipping {Description} because it does not support service type {Service}", - context.PipelineDescription, config.ServiceType); + log.Debug("Skipping this pipeline because it does not support service type {Service}", config.ServiceType); return; } diff --git a/src/Recyclarr.Cli/Pipelines/MediaNaming/MediaNamingPipelineContext.cs b/src/Recyclarr.Cli/Pipelines/MediaNaming/MediaNamingPipelineContext.cs index ff139a59..b19fff2b 100644 --- a/src/Recyclarr.Cli/Pipelines/MediaNaming/MediaNamingPipelineContext.cs +++ b/src/Recyclarr.Cli/Pipelines/MediaNaming/MediaNamingPipelineContext.cs @@ -7,7 +7,7 @@ namespace Recyclarr.Cli.Pipelines.MediaNaming; public class MediaNamingPipelineContext : IPipelineContext { - public string PipelineDescription => "Media Naming Pipeline"; + public string PipelineDescription => "Media Naming"; public IReadOnlyCollection SupportedServiceTypes { get; } = new[] { SupportedServices.Sonarr, diff --git a/src/Recyclarr.Cli/Pipelines/QualityProfile/QualityProfilePipelineContext.cs b/src/Recyclarr.Cli/Pipelines/QualityProfile/QualityProfilePipelineContext.cs index aea9d345..0fd29bf2 100644 --- a/src/Recyclarr.Cli/Pipelines/QualityProfile/QualityProfilePipelineContext.cs +++ b/src/Recyclarr.Cli/Pipelines/QualityProfile/QualityProfilePipelineContext.cs @@ -10,7 +10,7 @@ namespace Recyclarr.Cli.Pipelines.QualityProfile; "Context objects are similar to DTOs; for usability we want to assign not append")] public class QualityProfilePipelineContext : IPipelineContext { - public string PipelineDescription => "Quality Definition Pipeline"; + public string PipelineDescription => "Quality Definition"; public IReadOnlyCollection SupportedServiceTypes { get; } = new[] { SupportedServices.Sonarr, diff --git a/src/Recyclarr.Cli/Pipelines/QualitySize/QualitySizePipelineContext.cs b/src/Recyclarr.Cli/Pipelines/QualitySize/QualitySizePipelineContext.cs index 0b5ef132..787aa2b5 100644 --- a/src/Recyclarr.Cli/Pipelines/QualitySize/QualitySizePipelineContext.cs +++ b/src/Recyclarr.Cli/Pipelines/QualitySize/QualitySizePipelineContext.cs @@ -10,7 +10,7 @@ namespace Recyclarr.Cli.Pipelines.QualitySize; "Context objects are similar to DTOs; for usability we want to assign not append")] public class QualitySizePipelineContext : IPipelineContext { - public string PipelineDescription => "Quality Definition Pipeline"; + public string PipelineDescription => "Quality Definition"; public IReadOnlyCollection SupportedServiceTypes { get; } = new[] { SupportedServices.Sonarr, diff --git a/src/Recyclarr.Cli/Processors/Sync/SyncPipelineExecutor.cs b/src/Recyclarr.Cli/Processors/Sync/SyncPipelineExecutor.cs index 481934ef..c7b4c727 100644 --- a/src/Recyclarr.Cli/Processors/Sync/SyncPipelineExecutor.cs +++ b/src/Recyclarr.Cli/Processors/Sync/SyncPipelineExecutor.cs @@ -27,7 +27,6 @@ public class SyncPipelineExecutor( foreach (var pipeline in pipelines) { - log.Debug("Executing Pipeline: {Pipeline}", pipeline.GetType().Name); await pipeline.Execute(settings, ct); }