fix(emby): Add more logging on the PlaySync to check for Tv Shows without a valid TMDB

pull/5072/head
tidusjar 11 months ago
parent 3f1a336c3d
commit 08eb13b788

@ -174,13 +174,18 @@ namespace Ombi.Schedule.Jobs.Emby
} }
if (parent.TheMovieDbId.IsNullOrEmpty()) 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; return;
} }
await AddToContent(content, new UserPlayedEpisode() await AddToContent(content, new UserPlayedEpisode()
{ {
TheMovieDbId = int.Parse(parent.TheMovieDbId), TheMovieDbId = parentMovieDb,
SeasonNumber = episode.ParentIndexNumber, SeasonNumber = episode.ParentIndexNumber,
EpisodeNumber = episode.IndexNumber, EpisodeNumber = episode.IndexNumber,
UserId = user.Id UserId = user.Id
@ -196,7 +201,7 @@ namespace Ombi.Schedule.Jobs.Emby
await AddToContent(content, new UserPlayedEpisode() await AddToContent(content, new UserPlayedEpisode()
{ {
TheMovieDbId = int.Parse(parent.TheMovieDbId), TheMovieDbId = parentMovieDb,
SeasonNumber = episode.ParentIndexNumber, SeasonNumber = episode.ParentIndexNumber,
EpisodeNumber = episodeNumber, EpisodeNumber = episodeNumber,
UserId = user.Id UserId = user.Id

Loading…
Cancel
Save