fix: Support duplicates in Emby/JF collections (#4902)

Support same movie that belongs in different collections
in Emby or Jellyfin
This commit is contained in:
sephrat 2023-04-13 19:01:07 +02:00 committed by GitHub
commit 141f96da5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View file

@ -263,7 +263,12 @@ namespace Ombi.Schedule.Jobs.Emby
// Check if it exists // Check if it exists
var existingMovie = await _repo.GetByEmbyId(movieInfo.Id); var existingMovie = await _repo.GetByEmbyId(movieInfo.Id);
var alreadyGoingToAdd = content.Any(x => x.EmbyId == movieInfo.Id); var alreadyGoingToAdd = content.Any(x => x.EmbyId == movieInfo.Id);
if (existingMovie == null && !alreadyGoingToAdd) if (alreadyGoingToAdd)
{
_logger.LogDebug($"Detected duplicate for {movieInfo.Name}");
return;
}
if (existingMovie == null)
{ {
if (!movieInfo.ProviderIds.Any()) if (!movieInfo.ProviderIds.Any())
{ {

View file

@ -228,7 +228,12 @@ namespace Ombi.Schedule.Jobs.Jellyfin
// Check if it exists // Check if it exists
var existingMovie = await _repo.GetByJellyfinId(movieInfo.Id); var existingMovie = await _repo.GetByJellyfinId(movieInfo.Id);
var alreadyGoingToAdd = content.Any(x => x.JellyfinId == movieInfo.Id); var alreadyGoingToAdd = content.Any(x => x.JellyfinId == movieInfo.Id);
if (existingMovie == null && !alreadyGoingToAdd) if (alreadyGoingToAdd)
{
_logger.LogDebug($"Detected duplicate for {movieInfo.Name}");
return;
}
if (existingMovie == null)
{ {
if (!movieInfo.ProviderIds.Any()) if (!movieInfo.ProviderIds.Any())
{ {