Skip to content

Commit

Permalink
fix: Support duplicates in Emby/JF collections (#4902)
Browse files Browse the repository at this point in the history
Support same movie that belongs in different collections
in Emby or Jellyfin
  • Loading branch information
sephrat authored Apr 13, 2023
1 parent c262b7c commit 141f96d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/Ombi.Schedule/Jobs/Emby/EmbyContentSync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,12 @@ private async Task ProcessMovies(EmbyMovie movieInfo, ICollection<EmbyContent> c
// Check if it exists
var existingMovie = await _repo.GetByEmbyId(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())
{
Expand Down
7 changes: 6 additions & 1 deletion src/Ombi.Schedule/Jobs/Jellyfin/JellyfinContentSync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,12 @@ private async Task ProcessMovies(JellyfinMovie movieInfo, ICollection<JellyfinCo
// Check if it exists
var existingMovie = await _repo.GetByJellyfinId(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())
{
Expand Down

0 comments on commit 141f96d

Please sign in to comment.