Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Specials being added during season refresh when IncludeMissingSpecials is disabled #152

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Jellyfin.Plugin.Tvdb/Configuration/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ <h2 class="sectionTitle">TheTVDB Settings:</h2>
document.getElementById('cacheDurationInDays').value = config.CacheDurationInDays;
document.getElementById('metadataUpdateInHours').value = config.MetadataUpdateInHours;
document.getElementById('fallbackLanguages').value = config.FallbackLanguages;
document.getElementById('includeMissingSpecials').checked = config.IncludeMissingSpecials || true;
document.getElementById('includeMissingSpecials').checked = config.IncludeMissingSpecials;
Dashboard.hideLoadingMsg();
});
},
Expand Down
7 changes: 7 additions & 0 deletions Jellyfin.Plugin.Tvdb/Providers/TvdbMissingEpisodeProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,13 @@ private async Task HandleSeason(Season season, IReadOnlyList<EpisodeBaseRecord>?
var allEpisodes = allEpisodesRemote ?? await GetAllEpisodes(tvdbId, series.DisplayOrder, season.GetPreferredMetadataLanguage())
.ConfigureAwait(false);

// Skip if called from HandleSeries since it will be filtered there, allEpisodesRemote will not be null when called from HandleSeries
// Remove specials if IncludeMissingSpecials is false
if (allEpisodesRemote is null && !IncludeMissingSpecials)
{
allEpisodes = allEpisodes.Where(e => e.SeasonNumber != 0).ToList();
}

var seasonEpisodes = allEpisodes.Where(e => e.SeasonNumber == season.IndexNumber).ToList();
var existingEpisodes = season.GetEpisodes().OfType<Episode>().ToHashSet();

Expand Down