From c92c3c833091d989a7e41c070a1329fb7ed516d9 Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Mon, 11 Nov 2024 10:10:15 -0800 Subject: [PATCH 1/2] Fix Media Cache Handler --- .../Events/DefaultMediaFileStoreCacheEventHandler.cs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/OrchardCore/OrchardCore.Media.Core/Events/DefaultMediaFileStoreCacheEventHandler.cs b/src/OrchardCore/OrchardCore.Media.Core/Events/DefaultMediaFileStoreCacheEventHandler.cs index 58d6bcf7c4b..81c45b1fe81 100644 --- a/src/OrchardCore/OrchardCore.Media.Core/Events/DefaultMediaFileStoreCacheEventHandler.cs +++ b/src/OrchardCore/OrchardCore.Media.Core/Events/DefaultMediaFileStoreCacheEventHandler.cs @@ -13,22 +13,16 @@ public DefaultMediaFileStoreCacheEventHandler(IMediaFileStoreCacheFileProvider m public override Task MediaDeletedDirectoryAsync(MediaDeletedContext context) { - _mediaFileStoreCacheFileProvider.TryDeleteDirectoryAsync(context.Path); - - return Task.CompletedTask; + return _mediaFileStoreCacheFileProvider.TryDeleteDirectoryAsync(context.Path); } public override Task MediaDeletedFileAsync(MediaDeletedContext context) { - _mediaFileStoreCacheFileProvider.TryDeleteFileAsync(context.Path); - - return Task.CompletedTask; + return _mediaFileStoreCacheFileProvider.TryDeleteFileAsync(context.Path); } public override Task MediaMovedAsync(MediaMoveContext context) { - _mediaFileStoreCacheFileProvider.TryDeleteFileAsync(context.OldPath); - - return Task.CompletedTask; + return _mediaFileStoreCacheFileProvider.TryDeleteFileAsync(context.OldPath); } } From 7c1b8cc693aaf0cbfb7414e6d2562db48ad7c4e9 Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Mon, 11 Nov 2024 10:12:01 -0800 Subject: [PATCH 2/2] expression --- .../Events/DefaultMediaFileStoreCacheEventHandler.cs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/OrchardCore/OrchardCore.Media.Core/Events/DefaultMediaFileStoreCacheEventHandler.cs b/src/OrchardCore/OrchardCore.Media.Core/Events/DefaultMediaFileStoreCacheEventHandler.cs index 81c45b1fe81..bace86eed14 100644 --- a/src/OrchardCore/OrchardCore.Media.Core/Events/DefaultMediaFileStoreCacheEventHandler.cs +++ b/src/OrchardCore/OrchardCore.Media.Core/Events/DefaultMediaFileStoreCacheEventHandler.cs @@ -12,17 +12,11 @@ public DefaultMediaFileStoreCacheEventHandler(IMediaFileStoreCacheFileProvider m } public override Task MediaDeletedDirectoryAsync(MediaDeletedContext context) - { - return _mediaFileStoreCacheFileProvider.TryDeleteDirectoryAsync(context.Path); - } + => _mediaFileStoreCacheFileProvider.TryDeleteDirectoryAsync(context.Path); public override Task MediaDeletedFileAsync(MediaDeletedContext context) - { - return _mediaFileStoreCacheFileProvider.TryDeleteFileAsync(context.Path); - } + => _mediaFileStoreCacheFileProvider.TryDeleteFileAsync(context.Path); public override Task MediaMovedAsync(MediaMoveContext context) - { - return _mediaFileStoreCacheFileProvider.TryDeleteFileAsync(context.OldPath); - } + => _mediaFileStoreCacheFileProvider.TryDeleteFileAsync(context.OldPath); }