+
Loading...
diff --git a/Jellyfin.Plugin.MediaCleaner/Pages/home.js b/Jellyfin.Plugin.MediaCleaner/Pages/home.js
index ea248fd..d082522 100644
--- a/Jellyfin.Plugin.MediaCleaner/Pages/home.js
+++ b/Jellyfin.Plugin.MediaCleaner/Pages/home.js
@@ -1,5 +1,4 @@
document.addEventListener('pageshow', async () => {
- await fetchHomepageCSS();
await updateMediaCleanerState();
var moviesTitle = document.getElementById("moviesTitle");
@@ -81,7 +80,8 @@ const populateTables = async () => {
cell1.innerHTML = moviesInfo[i].Name;
// Will need to be enabled once radarr and sonarr integration is enabled.
// Maybe change this to an element to remove hard coding.
- cell2.innerHTML = "";
+ cell2.innerHTML = "";
+ cell2.className = "actions-cell";
}
}
else{
@@ -102,7 +102,7 @@ const populateTables = async () => {
cell2.innerHTML = seriesInfo[i].Seasons.map(season => season.replace("Season ", "")).join(", ");
// Will need to be enabled once radarr and sonarr integration is enabled.
// Maybe change this to an element to remove hard coding.
- cell3.innerHTML = "";
+ cell3.innerHTML = "";
cell3.className = "actions-cell";
}
}
@@ -136,16 +136,3 @@ const finishLoading = () => {
console.log("Loading element: ", loadingElement);
console.log("Homepage element: ", homepage);
}
-
-const fetchHomepageCSS = async () => {
- const response = await fetch('/web/configurationpage?name=home.css')
-
- if(!response.ok){
- throw new Error(`Response status: ${response.status}`);
- }
-
- const css = await response.text();
- const styles = document.createElement('style');
- styles.textContent = css;
- document.head.appendChild(styles);
-}
diff --git a/Jellyfin.Plugin.MediaCleaner/StaleMediaScanner.cs b/Jellyfin.Plugin.MediaCleaner/StaleMediaScanner.cs
index fde16f9..5c94753 100644
--- a/Jellyfin.Plugin.MediaCleaner/StaleMediaScanner.cs
+++ b/Jellyfin.Plugin.MediaCleaner/StaleMediaScanner.cs
@@ -154,21 +154,10 @@ public sealed class StaleMediaScanner
return staleMovies;
}
-
- private List GetStaleSeasons(BaseItem item)
+ private IEnumerable GetStaleSeasonsWithShortCircuitOnNonStaleSeason(IEnumerable 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 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 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 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("-------------------------------------------------");