From 719e8a0c070dd75c3d5e15c0ad27e67a5b3f7d79 Mon Sep 17 00:00:00 2001 From: Jason Dove <1695733+jasongdove@users.noreply.github.com> Date: Fri, 16 Jan 2026 13:43:50 -0600 Subject: [PATCH] update messaging --- .../Commands/DeleteOrphanedArtworkHandler.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ErsatzTV.Application/Maintenance/Commands/DeleteOrphanedArtworkHandler.cs b/ErsatzTV.Application/Maintenance/Commands/DeleteOrphanedArtworkHandler.cs index 627135be2..bf7077dae 100644 --- a/ErsatzTV.Application/Maintenance/Commands/DeleteOrphanedArtworkHandler.cs +++ b/ErsatzTV.Application/Maintenance/Commands/DeleteOrphanedArtworkHandler.cs @@ -1,8 +1,10 @@ -using System.IO.Abstractions; +using System.Globalization; +using System.IO.Abstractions; using ErsatzTV.Core; using ErsatzTV.Core.Interfaces.Repositories; using ErsatzTV.Infrastructure.Data; using ErsatzTV.Infrastructure.Images; +using Humanizer; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; @@ -93,6 +95,7 @@ public class DeleteOrphanedArtworkHandler( logger.LogDebug("Loaded {Count} artwork hashes (valid file names)", validFiles.Count); var deleted = 0; + long bytes = 0; foreach (string file in fileSystem.Directory.EnumerateFiles( FileSystemLayout.ArtworkCacheFolder, "*.*", @@ -103,6 +106,8 @@ public class DeleteOrphanedArtworkHandler( { try { + bytes += fileSystem.FileInfo.New(file).Length; + fileSystem.File.Delete(file); deleted++; } @@ -113,7 +118,10 @@ public class DeleteOrphanedArtworkHandler( } } - logger.LogDebug("Deleted {Count} unused artwork cache files", deleted); + logger.LogDebug( + "Deleted {Count} unused artwork cache files totaling {Size}", + deleted, + bytes.Bytes().Humanize(CultureInfo.CurrentCulture)); DeleteEmptySubfolders(FileSystemLayout.ArtworkCacheFolder); }