diff --git a/Trakt/Extensions.cs b/Trakt/Extensions.cs index 2c914c3..bc7edd1 100644 --- a/Trakt/Extensions.cs +++ b/Trakt/Extensions.cs @@ -559,34 +559,18 @@ public static class Extensions /// indicating if the matches a . public static bool IsMatch(Episode item, TraktEpisodeWatchedHistory episodeHistory) { - bool match = false; - - // Match by provider id's if available, Match by show, season and episode number if not - if (HasAnyProviderTvIds(item) && HasAnyProviderTvIds(episodeHistory.Episode)) + // Match by provider id's + if (IsMatch(item, episodeHistory.Episode)) { - match = IsMatch(item, episodeHistory.Episode); - } - else - { - match = IsMatch(item.Series, episodeHistory.Show) && item.GetSeasonNumber() == episodeHistory.Episode.Season && item.ContainsEpisodeNumber(episodeHistory.Episode.Number); + return true; } - return match; - } + // Match by show, season and episode number + if (IsMatch(item.Series, episodeHistory.Show) && item.GetSeasonNumber() == episodeHistory.Episode.Season && item.ContainsEpisodeNumber(episodeHistory.Episode.Number)) + { + return true; + } - private static bool HasAnyProviderTvIds(Episode item) - { - return item.HasProviderId(MetadataProvider.Tvdb) - || item.HasProviderId(MetadataProvider.Tmdb) - || item.HasProviderId(MetadataProvider.Imdb) - || item.HasProviderId(MetadataProvider.TvRage); - } - - private static bool HasAnyProviderTvIds(TraktEpisode item) - { - return item.Ids.Tvdb != null - || item.Ids.Tmdb != null - || item.Ids.Imdb != null - || item.Ids.Tvrage != null; + return false; } }