mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-22 22:23:34 -07:00
Add sanity checks upon media server sync
Fixes Media content may be improperly imported into Ombi #4472
This commit is contained in:
parent
004e135b2d
commit
f926d94288
8 changed files with 67 additions and 0 deletions
|
@ -9,5 +9,19 @@
|
|||
public string Tvdb { get; set; }
|
||||
public string Zap2It { get; set; }
|
||||
public string TvRage { get; set; }
|
||||
|
||||
public bool Any()
|
||||
{
|
||||
if (string.IsNullOrEmpty(Imdb)
|
||||
&& string.IsNullOrEmpty(Tmdb)
|
||||
&& string.IsNullOrEmpty(Tvdb))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -9,5 +9,19 @@
|
|||
public string Tvdb { get; set; }
|
||||
public string Zap2It { get; set; }
|
||||
public string TvRage { get; set; }
|
||||
|
||||
public bool Any()
|
||||
{
|
||||
if (string.IsNullOrEmpty(Imdb)
|
||||
&& string.IsNullOrEmpty(Tmdb)
|
||||
&& string.IsNullOrEmpty(Tvdb))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -249,6 +249,13 @@ namespace Ombi.Schedule.Jobs.Emby
|
|||
var alreadyGoingToAdd = content.Any(x => x.EmbyId == movieInfo.Id);
|
||||
if (existingMovie == null && !alreadyGoingToAdd)
|
||||
{
|
||||
|
||||
if (string.IsNullOrEmpty(movieInfo.ProviderIds?.Imdb)
|
||||
&& string.IsNullOrEmpty(movieInfo.ProviderIds?.Tmdb))
|
||||
{
|
||||
_logger.LogWarning($"Movie {0} has no relevant metadata. Skipping.", movieInfo.Name);
|
||||
return;
|
||||
}
|
||||
_logger.LogDebug("Adding new movie {0}", movieInfo.Name);
|
||||
content.Add(new EmbyContent
|
||||
{
|
||||
|
|
|
@ -152,6 +152,13 @@ namespace Ombi.Schedule.Jobs.Emby
|
|||
|
||||
if (existingEpisode == null && !existingInList)
|
||||
{
|
||||
// Sanity checks
|
||||
if (ep.IndexNumber == 0)
|
||||
{
|
||||
_logger.LogWarning($"Episode {ep.Name} has no episode number. Skipping.");
|
||||
continue;
|
||||
}
|
||||
|
||||
_logger.LogDebug("Adding new episode {0} to parent {1}", ep.Name, ep.SeriesName);
|
||||
// add it
|
||||
epToAdd.Add(new EmbyEpisode
|
||||
|
|
|
@ -217,6 +217,12 @@ namespace Ombi.Schedule.Jobs.Jellyfin
|
|||
var alreadyGoingToAdd = content.Any(x => x.JellyfinId == movieInfo.Id);
|
||||
if (existingMovie == null && !alreadyGoingToAdd)
|
||||
{
|
||||
if (string.IsNullOrEmpty(movieInfo.ProviderIds?.Imdb)
|
||||
&& string.IsNullOrEmpty(movieInfo.ProviderIds?.Tmdb))
|
||||
{
|
||||
_logger.LogWarning($"Movie {0} has no relevant metadata. Skipping.", movieInfo.Name);
|
||||
return;
|
||||
}
|
||||
_logger.LogDebug("Adding new movie {0}", movieInfo.Name);
|
||||
content.Add(new JellyfinContent
|
||||
{
|
||||
|
|
|
@ -128,6 +128,13 @@ namespace Ombi.Schedule.Jobs.Jellyfin
|
|||
|
||||
if (existingEpisode == null && !existingInList)
|
||||
{
|
||||
// Sanity checks
|
||||
if (ep.IndexNumber == 0) // no check on season number, Season 0 can be Specials
|
||||
{
|
||||
_logger.LogWarning($"Episode {ep.Name} has no episode number. Skipping.");
|
||||
return;
|
||||
}
|
||||
|
||||
_logger.LogDebug("Adding new episode {0} to parent {1}", ep.Name, ep.SeriesName);
|
||||
// add it
|
||||
epToAdd.Add(new JellyfinEpisode
|
||||
|
|
|
@ -342,6 +342,11 @@ namespace Ombi.Schedule.Jobs.Plex
|
|||
}
|
||||
}
|
||||
|
||||
if (!guids.Any())
|
||||
{
|
||||
Logger.LogWarning($"Movie {0} has no relevant metadata. Skipping.", movie.title);
|
||||
continue;
|
||||
}
|
||||
var providerIds = PlexHelper.GetProviderIdsFromMetadata(guids.ToArray());
|
||||
|
||||
var item = new PlexServerContent
|
||||
|
|
|
@ -179,6 +179,13 @@ namespace Ombi.Schedule.Jobs.Plex
|
|||
episode.grandparentRatingKey = seriesExists.Key;
|
||||
}
|
||||
|
||||
// Sanity checks
|
||||
if (episode.index == 0)
|
||||
{
|
||||
_log.LogWarning($"Episode {episode.title} has no episode number. Skipping.");
|
||||
continue;
|
||||
}
|
||||
|
||||
ep.Add(new PlexEpisode
|
||||
{
|
||||
EpisodeNumber = episode.index,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue