Revert last 3 commits

This commit is contained in:
h3llrais3r 2023-03-04 07:06:10 +01:00
parent 096a5c94de
commit 6bd9964779

View File

@ -559,34 +559,18 @@ public static class Extensions
/// <returns><see cref="bool"/> indicating if the <see cref="Episode"/> matches a <see cref="TraktEpisodeWatchedHistory"/>.</returns>
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;
}
}