mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 12:59:39 -07:00
Performance improvement coming from the previous change
This commit is contained in:
parent
2a284ce75c
commit
9c0d8f91e9
1 changed files with 11 additions and 7 deletions
|
@ -154,6 +154,9 @@ namespace Ombi.Core.Engine.V2
|
|||
|
||||
foreach (var tvMazeSearch in items)
|
||||
{
|
||||
if (settings.HideAvailableFromDiscover)
|
||||
{
|
||||
// To hide, we need to know if it's fully available, the only way to do this is to lookup it's episodes to check if we have every episode
|
||||
var show = await Cache.GetOrAdd(nameof(GetShowInformation) + tvMazeSearch.Id.ToString(),
|
||||
async () => await _movieApi.GetTVInfo(tvMazeSearch.Id.ToString()), DateTime.Now.AddHours(12));
|
||||
foreach (var tvSeason in show.seasons.Where(x => x.season_number != 0)) // skip the first season
|
||||
|
@ -165,6 +168,7 @@ namespace Ombi.Core.Engine.V2
|
|||
|
||||
MapSeasons(tvMazeSearch.SeasonRequests, tvSeason, seasonEpisodes);
|
||||
}
|
||||
}
|
||||
|
||||
var result = await ProcessResult(tvMazeSearch);
|
||||
if (result == null || settings.HideAvailableFromDiscover && result.FullyAvailable)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue