Improved logging futher and updated some methods to use LogDebugInformation and to handle exceptions
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -69,10 +69,7 @@ public class SeriesHelper(ILogger logger)
|
||||
|
||||
public bool IsSeasonDataStale(IReadOnlyList<BaseItem> episodes)
|
||||
{
|
||||
if(episodes == null)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(episodes);
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(episodes, "IsSeasonDataStale process recieved null episodes. Logic failure. Exception thrown.");
|
||||
|
||||
bool seasonIsStale = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user