mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-21 05:43:19 -07:00
Another attempt to fix #2366
This commit is contained in:
parent
35453754a0
commit
c14f603705
1 changed files with 11 additions and 6 deletions
|
@ -81,7 +81,7 @@ namespace Ombi.Schedule.Jobs.Emby
|
|||
{
|
||||
foreach (var movie in movies.Items)
|
||||
{
|
||||
if (movie.Type.Equals("boxset", StringComparison.CurrentCultureIgnoreCase) && mediaToAdd.All(x => x.EmbyId != movie.Id))
|
||||
if (movie.Type.Equals("boxset", StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
var movieInfo =
|
||||
await _api.GetCollection(movie.Id, server.ApiKey, server.AdministratorId, server.FullUri);
|
||||
|
@ -89,10 +89,15 @@ namespace Ombi.Schedule.Jobs.Emby
|
|||
{
|
||||
await ProcessMovies(item, mediaToAdd);
|
||||
}
|
||||
|
||||
processed++;
|
||||
}
|
||||
else
|
||||
{
|
||||
processed++;
|
||||
// Regular movie
|
||||
await ProcessMovies(movie, mediaToAdd);
|
||||
}
|
||||
processed++;
|
||||
// Regular movie
|
||||
await ProcessMovies(movie, mediaToAdd);
|
||||
}
|
||||
|
||||
// Get the next batch
|
||||
|
@ -163,8 +168,8 @@ namespace Ombi.Schedule.Jobs.Emby
|
|||
{
|
||||
// Check if it exists
|
||||
var existingMovie = await _repo.GetByEmbyId(movieInfo.Id);
|
||||
|
||||
if (existingMovie == null)
|
||||
var alreadyGoingToAdd = content.Any(x => x.EmbyId == movieInfo.Id);
|
||||
if (existingMovie == null && !alreadyGoingToAdd)
|
||||
{
|
||||
_logger.LogDebug("Adding new movie {0}", movieInfo.Name);
|
||||
content.Add(new EmbyContent
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue