Better logging when an item is not published

This commit is contained in:
Florian Dupret 2022-01-19 13:40:46 +01:00
commit 07124e84ad

View file

@ -502,12 +502,14 @@ namespace Ombi.Schedule.Jobs.Ombi
int.TryParse(content.TheMovieDbId, out var movieDbId); int.TryParse(content.TheMovieDbId, out var movieDbId);
if (movieDbId <= 0) if (movieDbId <= 0)
{ {
_log.LogWarning($"{content.Title} does not have a TMDB ID, it won't be published.");
continue; continue;
} }
var info = await _movieApi.GetMovieInformationWithExtraInfo(movieDbId, defaultLanguageCode); var info = await _movieApi.GetMovieInformationWithExtraInfo(movieDbId, defaultLanguageCode);
var mediaurl = content.Url; var mediaurl = content.Url;
if (info == null) if (info == null)
{ {
_log.LogWarning($"TMDB does not know movie {content.Title}, it won't be published.");
continue; continue;
} }
try try
@ -671,6 +673,8 @@ namespace Ombi.Schedule.Jobs.Ombi
var externals = await _movieApi.GetTvExternals(movieId); var externals = await _movieApi.GetTvExternals(movieId);
if (externals == null || externals.tvdb_id <= 0) if (externals == null || externals.tvdb_id <= 0)
{ {
// needed later for recently added log
_log.LogWarning($"{t.Title} has no TVDB ID, it won't be published.");
continue; continue;
} }
t.TvDbId = externals.tvdb_id.ToString(); t.TvDbId = externals.tvdb_id.ToString();
@ -694,6 +698,7 @@ namespace Ombi.Schedule.Jobs.Ombi
var tvInfo = await _movieApi.GetTVInfo(t.TheMovieDbId, languageCode); var tvInfo = await _movieApi.GetTVInfo(t.TheMovieDbId, languageCode);
if (tvInfo == null) if (tvInfo == null)
{ {
_log.LogWarning($"TMDB does not know series {t.Title}, it won't be published.");
continue; continue;
} }