Skip to content

Commit

Permalink
Adds data restrict to aired order only for missing data
Browse files Browse the repository at this point in the history
  • Loading branch information
scampower3 committed May 20, 2024
1 parent 4922829 commit 9f950d5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Jellyfin.Plugin.Tvdb/Providers/TvdbMissingEpisodeProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -449,15 +449,21 @@ private void AddVirtualEpisode(EpisodeBaseRecord? episode, Season? season)
IsVirtualItem = true,
SeasonId = season.Id,
SeriesId = season.Series.Id,
AirsBeforeEpisodeNumber = episode.AirsBeforeEpisode,
AirsAfterSeasonNumber = episode.AirsAfterSeason,
AirsBeforeSeasonNumber = episode.AirsBeforeSeason,
Overview = episode.Overview,
SeriesName = season.Series.Name,
SeriesPresentationUniqueKey = season.SeriesPresentationUniqueKey,
SeasonName = season.Name,
DateLastSaved = DateTime.UtcNow
};

// Below metadata info only applicable for Aired Order
if (string.IsNullOrEmpty(season.Series.DisplayOrder))
{
newEpisode.AirsBeforeEpisodeNumber = episode.AirsBeforeEpisode;
newEpisode.AirsAfterSeasonNumber = episode.AirsAfterSeason;
newEpisode.AirsBeforeSeasonNumber = episode.AirsBeforeSeason;
}

if (DateTime.TryParse(episode!.Aired, out var premiereDate))
{
newEpisode.PremiereDate = premiereDate;
Expand Down

0 comments on commit 9f950d5

Please sign in to comment.