mirror of
https://github.com/jellyfin/jellyfin-plugin-trakt.git
synced 2024-11-26 23:30:25 +00:00
Remove fallback logic with watched api
This commit is contained in:
parent
e1e77d97c6
commit
7b1481d921
@ -368,39 +368,9 @@ public class SyncFromTraktTask : IScheduledTask
|
||||
changed = UpdateEpisodeData(user, episode, userData, tLastPlayed, matchedWatchedEpisodeHistory.Count());
|
||||
}
|
||||
}
|
||||
else if (matchedWatchedSeason != null)
|
||||
{
|
||||
// Check for matching episodes including multi-episode entities
|
||||
var matchedWatchedEpisode = matchedWatchedSeason.Episodes.FirstOrDefault(x => episode.ContainsEpisodeNumber(x.Number));
|
||||
|
||||
// Prepend a check if the matched episode is on a rewatch cycle and
|
||||
// discard it if the last play date was before the reset date
|
||||
if (matchedWatchedEpisode != null
|
||||
&& tLastReset != null
|
||||
&& DateTime.TryParse(matchedWatchedEpisode.LastWatchedAt, out var lastPlayedValue)
|
||||
&& lastPlayedValue < tLastReset)
|
||||
{
|
||||
matchedWatchedEpisode = null;
|
||||
}
|
||||
|
||||
if (matchedWatchedEpisode != null)
|
||||
{
|
||||
_logger.LogDebug("Episode is in watched list of user {User}: {Data}", user.Username, GetVerboseEpisodeData(episode));
|
||||
|
||||
episodeWatched = true;
|
||||
DateTime? tLastPlayed = null;
|
||||
if (DateTime.TryParse(matchedWatchedEpisode.LastWatchedAt, out var lastWatchedValue))
|
||||
{
|
||||
tLastPlayed = lastWatchedValue;
|
||||
}
|
||||
|
||||
// Update episode data
|
||||
changed = UpdateEpisodeData(user, episode, userData, tLastPlayed, matchedWatchedEpisode.Plays);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.LogDebug("No season data found for user {User} for {Data}", user.Username, GetVerboseEpisodeData(episode));
|
||||
_logger.LogDebug("No episode history data found for user {User} for {Data}", user.Username, GetVerboseEpisodeData(episode));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user