diff --git a/Jellyfin.Plugin.Tvdb/Configuration/PluginConfiguration.cs b/Jellyfin.Plugin.Tvdb/Configuration/PluginConfiguration.cs index 00e57ae..b45fce6 100644 --- a/Jellyfin.Plugin.Tvdb/Configuration/PluginConfiguration.cs +++ b/Jellyfin.Plugin.Tvdb/Configuration/PluginConfiguration.cs @@ -52,14 +52,19 @@ public int CacheDurationInDays public bool ImportSeasonName { get; set; } = false; /// - /// Gets or sets a value indicating whether to include missing specials. + /// Gets or sets a value indicating whether to fallback to original language. + /// + public bool FallbackToOriginalLanguage { get; set; } = false; + + /// + /// Gets or sets a value indicating whether to include missing specials for Missing Episode Provider. /// public bool IncludeMissingSpecials { get; set; } = true; /// - /// Gets or sets a value indicating whether to fallback to original language. + /// Gets or sets a value indicating whether to remove all missing episodes on refresh for Missing Episode Provider. /// - public bool FallbackToOriginalLanguage { get; set; } = false; + public bool RemoveAllMissingEpisodesOnRefresh { get; set; } = false; /// /// Gets or sets the metadata update in hours for the Check for Metadata Updates Scheduled Task. diff --git a/Jellyfin.Plugin.Tvdb/Configuration/config.html b/Jellyfin.Plugin.Tvdb/Configuration/config.html index 309668f..0725e26 100644 --- a/Jellyfin.Plugin.Tvdb/Configuration/config.html +++ b/Jellyfin.Plugin.Tvdb/Configuration/config.html @@ -44,15 +44,22 @@

TheTVDB Settings:

+ +
+

Missing Episode Provider Settings:

+

Check for Metadata Updates Scheduled Task Settings:

@@ -102,9 +109,10 @@

Check for Metadata Updates Scheduled Task Settings:

Check for Metadata Updates Scheduled Task Settings: TvdbPlugin.Instance?.Configuration.IncludeMissingSpecials ?? false; + private static bool RemoveAllMissingEpisodesOnRefresh => TvdbPlugin.Instance?.Configuration.RemoveAllMissingEpisodesOnRefresh ?? false; + private static bool EpisodeExists(EpisodeBaseRecord episodeRecord, IReadOnlyList existingEpisodes) { return existingEpisodes.Any(episode => EpisodeEquals(episode, episodeRecord)); @@ -146,7 +148,9 @@ private async Task HandleSeries(Series series) } } - var allEpisodes = await GetAllEpisodes(tvdbId, series.DisplayOrder, series.GetPreferredMetadataLanguage()).ConfigureAwait(false); + var allEpisodes = RemoveAllMissingEpisodesOnRefresh ? + Enumerable.Empty().ToList() : + await GetAllEpisodes(tvdbId, series.DisplayOrder, series.GetPreferredMetadataLanguage()).ConfigureAwait(false); if (!IncludeMissingSpecials) { @@ -189,9 +193,11 @@ private async Task HandleSeason(Season season, IReadOnlyList? } var tvdbId = series.GetTvdbId(); - var allEpisodes = allEpisodesRemote ?? await GetAllEpisodes(tvdbId, series.DisplayOrder, season.GetPreferredMetadataLanguage()) - .ConfigureAwait(false); - + var allEpisodes = RemoveAllMissingEpisodesOnRefresh ? + Enumerable.Empty().ToList() : + 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)