diff --git a/CHANGELOG.md b/CHANGELOG.md index b69761346..60d316668 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - `ETV_SLOW_API_MS` - milliseconds threshold for logging slow API calls (at DEBUG level) - This is currently limited to *Jellyfin* - `ETV_JF_PAGE_SIZE` - page size for library scan API calls to Jellyfin; default value is 10 + - `ETV_JF_ENABLE_STATS` - enables logging timing information related to Jellyfin show library scans - Add `Select All` button to media pages by @Erotemic ### Fixed diff --git a/ErsatzTV.Core/SystemEnvironment.cs b/ErsatzTV.Core/SystemEnvironment.cs index 78dc636bc..f9eed6b53 100644 --- a/ErsatzTV.Core/SystemEnvironment.cs +++ b/ErsatzTV.Core/SystemEnvironment.cs @@ -56,6 +56,8 @@ public class SystemEnvironment } JellyfinPageSize = jellyfinPageSize; + + JellyfinEnableStats = !string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("ETV_JF_ENABLE_STATS")); } public static string BaseUrl { get; } @@ -68,4 +70,5 @@ public class SystemEnvironment public static int? SlowDbMs { get; } public static int? SlowApiMs { get; } public static int JellyfinPageSize { get; } + public static bool JellyfinEnableStats { get; } } diff --git a/ErsatzTV.Infrastructure/ScanProfiler.cs b/ErsatzTV.Infrastructure/ScanProfiler.cs index 8b02c7ba9..bd5fd07be 100644 --- a/ErsatzTV.Infrastructure/ScanProfiler.cs +++ b/ErsatzTV.Infrastructure/ScanProfiler.cs @@ -1,5 +1,6 @@ using System.Collections.Concurrent; using System.Diagnostics; +using ErsatzTV.Core; namespace ErsatzTV.Infrastructure; @@ -16,7 +17,7 @@ public static class ScanProfiler public static void LogStatistics(Action logAction) { - if (Measurements.IsEmpty) + if (!SystemEnvironment.JellyfinEnableStats || Measurements.IsEmpty) { return; }