Skip to content

Commit

Permalink
fix(emby): Add more logging on the PlaySync to check for Tv Shows wit…
Browse files Browse the repository at this point in the history
…hout a valid TMDB
  • Loading branch information
tidusjar committed Jan 11, 2024
1 parent 3f1a336 commit 08eb13b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Ombi.Schedule/Jobs/Emby/EmbyPlayedSync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,18 @@ private async Task ProcessTv(EmbyEpisodes episode, OmbiUser user, ICollection<Us
}
if (parent.TheMovieDbId.IsNullOrEmpty())
{
_logger.LogWarning($"Episode {episode.Name} is not linked to a TMDB series. Skipping.");
_logger.LogWarning($"Episode {episode.Name} for Tv Show {parent.Title} Doesn't have a valid TheMovieDbId. Skipping.");
return;
}
if (!int.TryParse(parent.TheMovieDbId, out var parentMovieDb))
{
_logger.LogWarning($"Episode {episode.Name} for Tv Show {parent.Title} Doesn't have a valid TheMovieDbId. Skipping.");
return;
}

await AddToContent(content, new UserPlayedEpisode()
{
TheMovieDbId = int.Parse(parent.TheMovieDbId),
TheMovieDbId = parentMovieDb,
SeasonNumber = episode.ParentIndexNumber,
EpisodeNumber = episode.IndexNumber,
UserId = user.Id
Expand All @@ -196,7 +201,7 @@ private async Task ProcessTv(EmbyEpisodes episode, OmbiUser user, ICollection<Us

await AddToContent(content, new UserPlayedEpisode()
{
TheMovieDbId = int.Parse(parent.TheMovieDbId),
TheMovieDbId = parentMovieDb,
SeasonNumber = episode.ParentIndexNumber,
EpisodeNumber = episodeNumber,
UserId = user.Id
Expand Down

0 comments on commit 08eb13b

Please sign in to comment.