From 42b00dc1a45feee2d7614cb9b323dbdad13333be Mon Sep 17 00:00:00 2001 From: ConfusedPolarBear <33811686+ConfusedPolarBear@users.noreply.github.com> Date: Sun, 12 Jun 2022 17:31:42 -0500 Subject: [PATCH] Change some log levels --- .../Entrypoint.cs | 12 +++++----- .../ScheduledTasks/FingerprinterTask.cs | 24 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Entrypoint.cs b/ConfusedPolarBear.Plugin.IntroSkipper/Entrypoint.cs index e1ee6f4..fd6611e 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Entrypoint.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Entrypoint.cs @@ -102,7 +102,7 @@ public class Entrypoint : IServerEntryPoint }; // Get all items from this library. Since intros may change within a season, sort the items before adding them. - _logger.LogTrace("Constructing user view folder"); + _logger.LogDebug("Constructing user view folder"); var folder = _userViewManager.GetUserViews(query)[0]; if (folder is null) @@ -111,7 +111,7 @@ public class Entrypoint : IServerEntryPoint return; } - _logger.LogTrace("Getting items in folder"); + _logger.LogDebug("Getting items in folder"); var items = folder.GetItems(new InternalItemsQuery() { ParentId = Guid.Parse(rawId), @@ -127,7 +127,7 @@ public class Entrypoint : IServerEntryPoint } // Queue all episodes on the server for fingerprinting. - _logger.LogTrace("Iterating through folder contents"); + _logger.LogDebug("Iterating through folder contents"); foreach (var item in items.Items) { if (item is not Episode episode) @@ -139,7 +139,7 @@ public class Entrypoint : IServerEntryPoint QueueEpisode(episode); } - _logger.LogTrace("Queued {Count} episodes", items.Items.Count); + _logger.LogDebug("Queued {Count} episodes", items.Items.Count); } /// @@ -206,11 +206,11 @@ public class Entrypoint : IServerEntryPoint { foreach (var user in _userManager.Users) { - _logger.LogTrace("Checking access of user {Username}", user.Username); + _logger.LogDebug("Checking access of user {Username}", user.Username); if (!user.HasPermission(Jellyfin.Data.Enums.PermissionKind.IsAdministrator)) { - _logger.LogTrace("User {Username} does not have the required access, continuing", user.Username); + _logger.LogDebug("User {Username} does not have the required access, continuing", user.Username); continue; } diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/FingerprinterTask.cs b/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/FingerprinterTask.cs index 7701378..7647fda 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/FingerprinterTask.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/FingerprinterTask.cs @@ -213,7 +213,7 @@ public class FingerprinterTask : IScheduledTask var alreadyDone = Plugin.Instance!.Intros; if (alreadyDone.ContainsKey(lhs.EpisodeId) && alreadyDone.ContainsKey(rhs.EpisodeId)) { - _logger.LogDebug( + _logger.LogTrace( "Episodes {LHS} and {RHS} have both already been fingerprinted", lhs.EpisodeId, rhs.EpisodeId); @@ -223,7 +223,7 @@ public class FingerprinterTask : IScheduledTask try { - _logger.LogDebug("Analyzing {LHS} and {RHS}", lhs.Path, rhs.Path); + _logger.LogTrace("Analyzing {LHS} and {RHS}", lhs.Path, rhs.Path); var (lhsIntro, rhsIntro) = FingerprintEpisodes(lhs, rhs); @@ -319,7 +319,7 @@ public class FingerprinterTask : IScheduledTask // If no valid ranges were found, re-analyze the episodes considering all possible shifts. if (lhsRanges.Count == 0) { - _logger.LogDebug("quick scan unsuccessful, falling back to full scan (±{Limit})", limit); + _logger.LogTrace("quick scan unsuccessful, falling back to full scan (±{Limit})", limit); (lhsContiguous, rhsContiguous) = ShiftEpisodes(lhsPoints, rhsPoints, -1 * limit, limit); lhsRanges.AddRange(lhsContiguous); @@ -327,12 +327,12 @@ public class FingerprinterTask : IScheduledTask } else { - _logger.LogDebug("quick scan successful"); + _logger.LogTrace("quick scan successful"); } if (lhsRanges.Count == 0) { - _logger.LogDebug( + _logger.LogTrace( "Unable to find a shared introduction sequence between {LHS} and {RHS}", lhsId, rhsId); @@ -504,7 +504,7 @@ public class FingerprinterTask : IScheduledTask } var percentValid = (validCount * 100) / totalCount; - _logger.LogDebug("Found intros in {Valid}/{Total} ({Percent}%) of episodes", validCount, totalCount, percentValid); + _logger.LogTrace("Found intros in {Valid}/{Total} ({Percent}%) of episodes", validCount, totalCount, percentValid); if (percentValid < 50) { return; @@ -549,7 +549,7 @@ public class FingerprinterTask : IScheduledTask // Ensure that the most frequently seen bucket has a majority percentValid = (maxBucket.Count * 100) / validCount; - _logger.LogDebug( + _logger.LogTrace( "Intro duration {Duration} appeared {Frequency} times ({Percent}%)", maxDuration, maxBucket.Count, @@ -560,7 +560,7 @@ public class FingerprinterTask : IScheduledTask return; } - _logger.LogDebug("Second pass is processing {Count} episodes", totalCount - maxBucket.Count); + _logger.LogTrace("Second pass is processing {Count} episodes", totalCount - maxBucket.Count); // Calculate a range of intro durations that are most likely to be correct. var maxEpisode = episodes.Find(x => x.EpisodeId == maxBucket.Episodes[0]); @@ -602,7 +602,7 @@ public class FingerprinterTask : IScheduledTask // If the episode's intro duration is close enough to the targeted bucket, leave it alone. if (Math.Abs(lhsDuration - oldDuration) <= ReanalysisTolerance) { - _logger.LogDebug( + _logger.LogTrace( "Not reanalyzing episode {Path} (intro is {Initial}, target is {Max})", shortPath, Math.Round(oldDuration, 2), @@ -611,7 +611,7 @@ public class FingerprinterTask : IScheduledTask continue; } - _logger.LogDebug( + _logger.LogTrace( "Reanalyzing episode {Path} (intro is {Initial}, target is {Max})", shortPath, Math.Round(oldDuration, 2), @@ -630,7 +630,7 @@ public class FingerprinterTask : IScheduledTask var newDuration = Math.Round(newRhs.IntroEnd - newRhs.IntroStart, 2); if (newDuration < oldDuration || newDuration < lowTargetDuration || newDuration > highTargetDuration) { - _logger.LogDebug( + _logger.LogTrace( "Ignoring reanalysis for {Path} (was {Initial}, now is {New})", shortPath, oldDuration, @@ -639,7 +639,7 @@ public class FingerprinterTask : IScheduledTask continue; } - _logger.LogDebug( + _logger.LogTrace( "Reanalysis succeeded for {Path} (was {Initial}, now is {New})", shortPath, oldDuration,