From 3fb8b1ebe5b07527820053f3cf306f971e82bac8 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Wed, 15 May 2019 16:43:21 +0100 Subject: [PATCH] Fixed #2374 --- .../Models/Media/Tv/EmbyEpisodes.cs | 1 + src/Ombi.Schedule/Jobs/Emby/EmbyEpisodeSync.cs | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/Ombi.Api.Emby/Models/Media/Tv/EmbyEpisodes.cs b/src/Ombi.Api.Emby/Models/Media/Tv/EmbyEpisodes.cs index d76915923..83d64ed15 100644 --- a/src/Ombi.Api.Emby/Models/Media/Tv/EmbyEpisodes.cs +++ b/src/Ombi.Api.Emby/Models/Media/Tv/EmbyEpisodes.cs @@ -16,6 +16,7 @@ namespace Ombi.Api.Emby.Models.Media.Tv public int ProductionYear { get; set; } public bool IsPlaceHolder { get; set; } public int IndexNumber { get; set; } + public int? IndexNumberEnd { get; set; } public int ParentIndexNumber { get; set; } public bool IsHD { get; set; } public bool IsFolder { get; set; } diff --git a/src/Ombi.Schedule/Jobs/Emby/EmbyEpisodeSync.cs b/src/Ombi.Schedule/Jobs/Emby/EmbyEpisodeSync.cs index e55c46d26..69ebdc42c 100644 --- a/src/Ombi.Schedule/Jobs/Emby/EmbyEpisodeSync.cs +++ b/src/Ombi.Schedule/Jobs/Emby/EmbyEpisodeSync.cs @@ -117,6 +117,22 @@ namespace Ombi.Schedule.Jobs.Emby Title = ep.Name, AddedAt = DateTime.UtcNow }); + + if (ep.IndexNumberEnd.HasValue && ep.IndexNumberEnd.Value != ep.IndexNumber) + { + epToAdd.Add(new EmbyEpisode + { + EmbyId = ep.Id, + EpisodeNumber = ep.IndexNumberEnd.Value, + SeasonNumber = ep.ParentIndexNumber, + ParentId = ep.SeriesId, + TvDbId = ep.ProviderIds.Tvdb, + TheMovieDbId = ep.ProviderIds.Tmdb, + ImdbId = ep.ProviderIds.Imdb, + Title = ep.Name, + AddedAt = DateTime.UtcNow + }); + } } }