Updated table to use check boxes for future selections. Added short circuiting when parsing seasons
This commit is contained in:
@@ -154,21 +154,10 @@ public sealed class StaleMediaScanner
|
||||
return staleMovies;
|
||||
}
|
||||
|
||||
|
||||
private List<BaseItem> GetStaleSeasons(BaseItem item)
|
||||
private IEnumerable<BaseItem> GetStaleSeasonsWithShortCircuitOnNonStaleSeason(IEnumerable<BaseItem> seasons)
|
||||
{
|
||||
_loggingHelper.LogDebugInformation("-------------------------------------------------");
|
||||
_loggingHelper.LogDebugInformation("Debug data for series: {SeriesName}", item.Name);
|
||||
_loggingHelper.LogDebugInformation("-------------------------------------------------");
|
||||
|
||||
var seasons = _libraryManager.GetItemList(new InternalItemsQuery
|
||||
foreach (BaseItem season in seasons)
|
||||
{
|
||||
ParentId = item.Id,
|
||||
Recursive = false
|
||||
});
|
||||
|
||||
List<BaseItem> staleSeasons = [ ..seasons
|
||||
.Where(season => {
|
||||
var episodes = _libraryManager.GetItemList(new InternalItemsQuery
|
||||
{
|
||||
ParentId = season.Id,
|
||||
@@ -185,14 +174,57 @@ public sealed class StaleMediaScanner
|
||||
}
|
||||
catch (ArgumentNullException ex)
|
||||
{
|
||||
_loggingHelper.LogInformation("Arguement Null Exception in GetStaleSeasons!");
|
||||
_loggingHelper.LogInformation("Argument Null Exception in GetStaleSeasons!");
|
||||
_loggingHelper.LogInformation(ex.Message);
|
||||
}
|
||||
|
||||
_loggingHelper.LogDebugInformation("End of season debug information for {SeasonNumber}.", season);
|
||||
|
||||
return isSeasonDataStale;
|
||||
})];
|
||||
if (!isSeasonDataStale) yield break;
|
||||
yield return season;
|
||||
}
|
||||
}
|
||||
|
||||
private List<BaseItem> GetStaleSeasons(BaseItem item)
|
||||
{
|
||||
_loggingHelper.LogDebugInformation("-------------------------------------------------");
|
||||
_loggingHelper.LogDebugInformation("Debug data for series: {SeriesName}", item.Name);
|
||||
_loggingHelper.LogDebugInformation("-------------------------------------------------");
|
||||
|
||||
var seasons = _libraryManager.GetItemList(new InternalItemsQuery
|
||||
{
|
||||
ParentId = item.Id,
|
||||
Recursive = false
|
||||
});
|
||||
|
||||
List<BaseItem> staleSeasons = [.. GetStaleSeasonsWithShortCircuitOnNonStaleSeason(seasons)];
|
||||
|
||||
// [ ..seasons
|
||||
// .Where(season => {
|
||||
// var episodes = _libraryManager.GetItemList(new InternalItemsQuery
|
||||
// {
|
||||
// ParentId = season.Id,
|
||||
// Recursive = false
|
||||
// });
|
||||
|
||||
// _loggingHelper.LogDebugInformation("Season debug information for {SeasonNumber}:", season);
|
||||
|
||||
// bool isSeasonDataStale = false;
|
||||
|
||||
// try
|
||||
// {
|
||||
// isSeasonDataStale = _seriesHelper.IsSeasonDataStale(episodes);
|
||||
// }
|
||||
// catch (ArgumentNullException ex)
|
||||
// {
|
||||
// _loggingHelper.LogInformation("Arguement Null Exception in GetStaleSeasons!");
|
||||
// _loggingHelper.LogInformation(ex.Message);
|
||||
// }
|
||||
|
||||
// _loggingHelper.LogDebugInformation("End of season debug information for {SeasonNumber}.", season);
|
||||
|
||||
// return isSeasonDataStale;
|
||||
// })];
|
||||
|
||||
|
||||
_loggingHelper.LogDebugInformation("-------------------------------------------------");
|
||||
|
||||
Reference in New Issue
Block a user