Continued to improve logging and fixed a few bugs introduced by refactor

This commit is contained in:
2026-01-24 23:14:16 -07:00
parent 9e324f14a7
commit 4fc8b4799d
4 changed files with 37 additions and 42 deletions

View File

@@ -17,7 +17,6 @@ public class MovieHelper(ILogger logger)
public bool IsMovieStale(BaseItem movie)
{
_loggingHelper.LogDebugInformation("-------------------------------------------------");
_loggingHelper.LogDebugInformation("Start of scanning for movie: {Movie}", movie);
_loggingHelper.LogDebugInformation("-------------------------------------------------");
@@ -41,19 +40,22 @@ public class MovieHelper(ILogger logger)
if (mostRecentUserData.LastPlayedDate < DateTime.Now.AddDays(-Configuration.StaleMediaCutoff))
{
_loggingHelper.LogDebugInformation("Most recent user data last played date is outside of cutoff. Adding {Movie} to stale movies.", movie);
_loggingHelper.LogDebugInformation("Most recent user data has last played date that is outside of cutoff.");
_loggingHelper.LogDebugInformation("Adding {Movie} to stale movies.", movie);
_loggingHelper.LogDebugInformation("With Last Played Date: {LastPlayedDate}", mostRecentUserData.LastPlayedDate);
movieIsStale = true;
}
}
else if (createdOutsideCutoff)
{
_loggingHelper.LogDebugInformation("Movie has no user data and was created outside of cutoff: {DateCreated}. Adding {Movie} to stale movies.", [movie.DateCreated, movie]);
_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;
}
_loggingHelper.LogDebugInformation("-------------------------------------------------");
_loggingHelper.LogDebugInformation("End of scanning for movie: {Movie}", movie);
_loggingHelper.LogDebugInformation("-------------------------------------------------");
return movieIsStale;
}