Continued to improve logging and fixed a few bugs introduced by refactor
This commit is contained in:
@@ -28,8 +28,13 @@ public class SeriesHelper(ILogger logger)
|
||||
var staleCreationDate = episode.DateCreated < DateTime.Now.AddDays(-Configuration.StaleMediaCutoff);
|
||||
var hasUserDataWithLastPlayedDate = episode.UserData.Any(data => data.LastPlayedDate != null);
|
||||
|
||||
_loggingHelper.LogDebugInformation("-------------------------------------------------");
|
||||
_loggingHelper.LogDebugInformation("Debug data for episode: {Episode}", episode);
|
||||
_loggingHelper.LogDebugInformation("-------------------------------------------------");
|
||||
|
||||
if (staleCreationDate && !hasUserDataWithLastPlayedDate){
|
||||
_loggingHelper.LogInformation("Creation date is stale, and no user data for episode {Episode}.", episode);
|
||||
_loggingHelper.LogDebugInformation("Creation date is stale, and no user data for episode {Episode}.", episode);
|
||||
_loggingHelper.LogDebugInformation("Date created: {DateCreated}", episode.DateCreated);
|
||||
episodeIsStale = true;
|
||||
}
|
||||
|
||||
@@ -38,9 +43,6 @@ public class SeriesHelper(ILogger logger)
|
||||
.OrderByDescending(data => data.LastPlayedDate)
|
||||
.First();
|
||||
|
||||
_loggingHelper.LogDebugInformation("User data for episode: {Episode}", episode);
|
||||
_loggingHelper.LogDebugInformation("-------------------------------------------------");
|
||||
|
||||
foreach (var property in typeof(UserData).GetProperties())
|
||||
{
|
||||
_loggingHelper.LogDebugInformation("{PropertyName}: {PropertyValue}", property.Name, property.GetValue(mostRecentUserData));
|
||||
@@ -54,7 +56,7 @@ public class SeriesHelper(ILogger logger)
|
||||
{
|
||||
episodeIsStale = true;
|
||||
_loggingHelper.LogDebugInformation("Most recent user data has a last played date of: {LastPlayedDate}.", [mostRecentUserData.LastPlayedDate]);
|
||||
_loggingHelper.LogDebugInformation("And episode created {DateCreated}.", episode.DateCreated);
|
||||
_loggingHelper.LogDebugInformation("Episode created {DateCreated}.", episode.DateCreated);
|
||||
_loggingHelper.LogDebugInformation("Episode is marked as stale.");
|
||||
}
|
||||
}
|
||||
@@ -79,6 +81,8 @@ public class SeriesHelper(ILogger logger)
|
||||
if(staleEpisodes.Count == episodes.Count)
|
||||
{
|
||||
seasonIsStale = true;
|
||||
|
||||
_loggingHelper.LogDebugInformation("-------------------------------------------------");
|
||||
_loggingHelper.LogDebugInformation("Stale episodes count matches season episode count. Season is stale.");
|
||||
_loggingHelper.LogDebugInformation("-------------------------------------------------");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user