From 28a7cda1d131dda68505a5f527ab330627e3fb13 Mon Sep 17 00:00:00 2001 From: Jason Dove <1695733+jasongdove@users.noreply.github.com> Date: Wed, 31 Dec 2025 14:03:43 -0600 Subject: [PATCH] feedback --- ErsatzTV.Core/SystemEnvironment.cs | 4 ++-- ErsatzTV/SlowApiHandler.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ErsatzTV.Core/SystemEnvironment.cs b/ErsatzTV.Core/SystemEnvironment.cs index f441601fe..78dc636bc 100644 --- a/ErsatzTV.Core/SystemEnvironment.cs +++ b/ErsatzTV.Core/SystemEnvironment.cs @@ -50,7 +50,7 @@ public class SystemEnvironment } string jellyfinPageSizeVariable = Environment.GetEnvironmentVariable("ETV_JF_PAGE_SIZE"); - if (!int.TryParse(jellyfinPageSizeVariable, out int jellyfinPageSize)) + if (!int.TryParse(jellyfinPageSizeVariable, out int jellyfinPageSize) || jellyfinPageSize <= 0) { jellyfinPageSize = 10; } @@ -67,5 +67,5 @@ public class SystemEnvironment public static int MaximumUploadMb { get; } public static int? SlowDbMs { get; } public static int? SlowApiMs { get; } - public static int JellyfinPageSize { get; set; } + public static int JellyfinPageSize { get; } } diff --git a/ErsatzTV/SlowApiHandler.cs b/ErsatzTV/SlowApiHandler.cs index f344a4654..997250b58 100644 --- a/ErsatzTV/SlowApiHandler.cs +++ b/ErsatzTV/SlowApiHandler.cs @@ -4,7 +4,7 @@ namespace ErsatzTV; using System.Diagnostics; -public class SlowApiHandler : DelegatingHandler +public class SlowApiHandler(ILogger logger) : DelegatingHandler { protected override async Task SendAsync( HttpRequestMessage request, @@ -23,7 +23,7 @@ public class SlowApiHandler : DelegatingHandler string uri = request.RequestUri?.ToString() ?? "Unknown URI"; string method = request.Method.Method; - Serilog.Log.Logger.Debug( + logger.LogDebug( "[SLOW API] {Method} {Uri} took {Milliseconds}ms", method, uri,