Change some log levels

This commit is contained in:
ConfusedPolarBear 2022-06-12 17:31:42 -05:00
parent cb3e69ac1c
commit 42b00dc1a4
2 changed files with 18 additions and 18 deletions

View File

@ -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. // 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]; var folder = _userViewManager.GetUserViews(query)[0];
if (folder is null) if (folder is null)
@ -111,7 +111,7 @@ public class Entrypoint : IServerEntryPoint
return; return;
} }
_logger.LogTrace("Getting items in folder"); _logger.LogDebug("Getting items in folder");
var items = folder.GetItems(new InternalItemsQuery() var items = folder.GetItems(new InternalItemsQuery()
{ {
ParentId = Guid.Parse(rawId), ParentId = Guid.Parse(rawId),
@ -127,7 +127,7 @@ public class Entrypoint : IServerEntryPoint
} }
// Queue all episodes on the server for fingerprinting. // 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) foreach (var item in items.Items)
{ {
if (item is not Episode episode) if (item is not Episode episode)
@ -139,7 +139,7 @@ public class Entrypoint : IServerEntryPoint
QueueEpisode(episode); QueueEpisode(episode);
} }
_logger.LogTrace("Queued {Count} episodes", items.Items.Count); _logger.LogDebug("Queued {Count} episodes", items.Items.Count);
} }
/// <summary> /// <summary>
@ -206,11 +206,11 @@ public class Entrypoint : IServerEntryPoint
{ {
foreach (var user in _userManager.Users) 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)) 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; continue;
} }

View File

@ -213,7 +213,7 @@ public class FingerprinterTask : IScheduledTask
var alreadyDone = Plugin.Instance!.Intros; var alreadyDone = Plugin.Instance!.Intros;
if (alreadyDone.ContainsKey(lhs.EpisodeId) && alreadyDone.ContainsKey(rhs.EpisodeId)) if (alreadyDone.ContainsKey(lhs.EpisodeId) && alreadyDone.ContainsKey(rhs.EpisodeId))
{ {
_logger.LogDebug( _logger.LogTrace(
"Episodes {LHS} and {RHS} have both already been fingerprinted", "Episodes {LHS} and {RHS} have both already been fingerprinted",
lhs.EpisodeId, lhs.EpisodeId,
rhs.EpisodeId); rhs.EpisodeId);
@ -223,7 +223,7 @@ public class FingerprinterTask : IScheduledTask
try 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); 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 no valid ranges were found, re-analyze the episodes considering all possible shifts.
if (lhsRanges.Count == 0) 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); (lhsContiguous, rhsContiguous) = ShiftEpisodes(lhsPoints, rhsPoints, -1 * limit, limit);
lhsRanges.AddRange(lhsContiguous); lhsRanges.AddRange(lhsContiguous);
@ -327,12 +327,12 @@ public class FingerprinterTask : IScheduledTask
} }
else else
{ {
_logger.LogDebug("quick scan successful"); _logger.LogTrace("quick scan successful");
} }
if (lhsRanges.Count == 0) if (lhsRanges.Count == 0)
{ {
_logger.LogDebug( _logger.LogTrace(
"Unable to find a shared introduction sequence between {LHS} and {RHS}", "Unable to find a shared introduction sequence between {LHS} and {RHS}",
lhsId, lhsId,
rhsId); rhsId);
@ -504,7 +504,7 @@ public class FingerprinterTask : IScheduledTask
} }
var percentValid = (validCount * 100) / totalCount; 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) if (percentValid < 50)
{ {
return; return;
@ -549,7 +549,7 @@ public class FingerprinterTask : IScheduledTask
// Ensure that the most frequently seen bucket has a majority // Ensure that the most frequently seen bucket has a majority
percentValid = (maxBucket.Count * 100) / validCount; percentValid = (maxBucket.Count * 100) / validCount;
_logger.LogDebug( _logger.LogTrace(
"Intro duration {Duration} appeared {Frequency} times ({Percent}%)", "Intro duration {Duration} appeared {Frequency} times ({Percent}%)",
maxDuration, maxDuration,
maxBucket.Count, maxBucket.Count,
@ -560,7 +560,7 @@ public class FingerprinterTask : IScheduledTask
return; 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. // Calculate a range of intro durations that are most likely to be correct.
var maxEpisode = episodes.Find(x => x.EpisodeId == maxBucket.Episodes[0]); 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 the episode's intro duration is close enough to the targeted bucket, leave it alone.
if (Math.Abs(lhsDuration - oldDuration) <= ReanalysisTolerance) if (Math.Abs(lhsDuration - oldDuration) <= ReanalysisTolerance)
{ {
_logger.LogDebug( _logger.LogTrace(
"Not reanalyzing episode {Path} (intro is {Initial}, target is {Max})", "Not reanalyzing episode {Path} (intro is {Initial}, target is {Max})",
shortPath, shortPath,
Math.Round(oldDuration, 2), Math.Round(oldDuration, 2),
@ -611,7 +611,7 @@ public class FingerprinterTask : IScheduledTask
continue; continue;
} }
_logger.LogDebug( _logger.LogTrace(
"Reanalyzing episode {Path} (intro is {Initial}, target is {Max})", "Reanalyzing episode {Path} (intro is {Initial}, target is {Max})",
shortPath, shortPath,
Math.Round(oldDuration, 2), Math.Round(oldDuration, 2),
@ -630,7 +630,7 @@ public class FingerprinterTask : IScheduledTask
var newDuration = Math.Round(newRhs.IntroEnd - newRhs.IntroStart, 2); var newDuration = Math.Round(newRhs.IntroEnd - newRhs.IntroStart, 2);
if (newDuration < oldDuration || newDuration < lowTargetDuration || newDuration > highTargetDuration) if (newDuration < oldDuration || newDuration < lowTargetDuration || newDuration > highTargetDuration)
{ {
_logger.LogDebug( _logger.LogTrace(
"Ignoring reanalysis for {Path} (was {Initial}, now is {New})", "Ignoring reanalysis for {Path} (was {Initial}, now is {New})",
shortPath, shortPath,
oldDuration, oldDuration,
@ -639,7 +639,7 @@ public class FingerprinterTask : IScheduledTask
continue; continue;
} }
_logger.LogDebug( _logger.LogTrace(
"Reanalysis succeeded for {Path} (was {Initial}, now is {New})", "Reanalysis succeeded for {Path} (was {Initial}, now is {New})",
shortPath, shortPath,
oldDuration, oldDuration,