Simplified some linq queries and fixed some debug logging getting through
This commit is contained in:
@@ -22,9 +22,12 @@ public class MovieHelper
|
||||
|
||||
public bool IsMovieStale(BaseItem movie)
|
||||
{
|
||||
_logger.LogInformation("-------------------------------------------------");
|
||||
_logger.LogInformation("Start of scanning for movie: {Movie}", movie);
|
||||
_logger.LogInformation("-------------------------------------------------");
|
||||
if (Configuration.DebugMode)
|
||||
{
|
||||
_logger.LogInformation("-------------------------------------------------");
|
||||
_logger.LogInformation("Start of scanning for movie: {Movie}", movie);
|
||||
_logger.LogInformation("-------------------------------------------------");
|
||||
}
|
||||
|
||||
bool movieIsStale = false;
|
||||
|
||||
@@ -33,7 +36,7 @@ public class MovieHelper
|
||||
|
||||
if (hasUserData)
|
||||
{
|
||||
var mostRecentUserData = movie.UserData.OrderByDescending(data => data.LastPlayedDate).Where(data => data.LastPlayedDate != null).First();
|
||||
var mostRecentUserData = movie.UserData.OrderByDescending(data => data.LastPlayedDate).First(data => data.LastPlayedDate != null);
|
||||
|
||||
if (Configuration.DebugMode){
|
||||
_logger.LogInformation("Most recent user data: {Movie}", movie);
|
||||
@@ -63,10 +66,12 @@ public class MovieHelper
|
||||
movieIsStale = true;
|
||||
}
|
||||
|
||||
|
||||
_logger.LogInformation("-------------------------------------------------");
|
||||
_logger.LogInformation("End of scanning for movie: {Movie}", movie);
|
||||
_logger.LogInformation("-------------------------------------------------");
|
||||
if (Configuration.DebugMode)
|
||||
{
|
||||
_logger.LogInformation("-------------------------------------------------");
|
||||
_logger.LogInformation("End of scanning for movie: {Movie}", movie);
|
||||
_logger.LogInformation("-------------------------------------------------");
|
||||
}
|
||||
|
||||
return movieIsStale;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user