mirror of
https://github.com/jellyfin/jellyfin-plugin-trakt.git
synced 2024-11-23 05:40:13 +00:00
Revert last 3 commits
This commit is contained in:
parent
096a5c94de
commit
6bd9964779
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user