Batch the PlexContentSync and increase the plex episode batch size

pull/1959/head
tidusjar 7 years ago
parent 6f06f962d7
commit 801b212bd4

@ -252,6 +252,11 @@ namespace Ombi.Schedule.Jobs.Plex
contentToAdd.Add(item);
}
}
if (contentToAdd.Count > 500)
{
await Repo.AddRange(contentToAdd);
contentToAdd = new List<PlexServerContent>();
}
}
if (contentToAdd.Any())

@ -99,7 +99,7 @@ namespace Ombi.Schedule.Jobs.Plex
private async Task GetEpisodes(PlexServers settings, Directory section)
{
var currentPosition = 0;
var resultCount = settings.EpisodeBatchSize == 0 ? 50 : settings.EpisodeBatchSize;
var resultCount = settings.EpisodeBatchSize == 0 ? 150 : settings.EpisodeBatchSize;
var episodes = await _api.GetAllEpisodes(settings.PlexAuthToken, settings.FullUri, section.key, currentPosition, resultCount);
_log.LogInformation(LoggingEvents.PlexEpisodeCacher, $"Total Epsiodes found for {episodes.MediaContainer.librarySectionTitle} = {episodes.MediaContainer.totalSize}");

Loading…
Cancel
Save