Improved logging futher and updated some methods to use LogDebugInformation and to handle exceptions

This commit is contained in:
2026-01-25 08:58:46 -07:00
parent 4fc8b4799d
commit 82441d5247
4 changed files with 47 additions and 15 deletions

View File

@@ -17,6 +17,8 @@ public class MovieHelper(ILogger logger)
public bool IsMovieStale(BaseItem movie)
{
ArgumentNullException.ThrowIfNull(movie, "IsMovieStale process recieved a null movie. Logic failure. Exception thrown.");
_loggingHelper.LogDebugInformation("Start of scanning for movie: {Movie}", movie);
_loggingHelper.LogDebugInformation("-------------------------------------------------");
@@ -47,13 +49,20 @@ public class MovieHelper(ILogger logger)
movieIsStale = true;
}
}
else if (createdOutsideCutoff)
if (createdOutsideCutoff && !hasUserData)
{
_loggingHelper.LogDebugInformation("Movie has no user data and was created outside of cutoff: {DateCreated}.", movie.DateCreated);
_loggingHelper.LogDebugInformation("Adding {Movie} to stale movies.", movie);
movieIsStale = true;
}
if (!createdOutsideCutoff && !hasUserData)
{
_loggingHelper.LogDebugInformation("Movie has no user data and was not created outside of cutoff: {DateCreated}.", movie.DateCreated);
_loggingHelper.LogDebugInformation("Movie is not stale.");
}
_loggingHelper.LogDebugInformation("-------------------------------------------------");
_loggingHelper.LogDebugInformation("End of scanning for movie: {Movie}", movie);