mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 13:23:20 -07:00
Show the TV show as available when we have all the episodes but future episodes have not aired. #2585
This commit is contained in:
parent
4edbe249ec
commit
d3c33fa804
2 changed files with 20 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
||||||
using System.Linq;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Ombi.Core.Models.Search;
|
using Ombi.Core.Models.Search;
|
||||||
|
@ -104,6 +105,21 @@ namespace Ombi.Core.Rule.Rules.Search
|
||||||
{
|
{
|
||||||
search.FullyAvailable = true;
|
search.FullyAvailable = true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var airedButNotAvailable = search.SeasonRequests.Any(x =>
|
||||||
|
x.Episodes.Any(c => !c.Available && c.AirDate <= DateTime.Now.Date));
|
||||||
|
if (!airedButNotAvailable)
|
||||||
|
{
|
||||||
|
var unairedEpisodes = search.SeasonRequests.Any(x =>
|
||||||
|
x.Episodes.Any(c => !c.Available && c.AirDate > DateTime.Now.Date));
|
||||||
|
if (unairedEpisodes)
|
||||||
|
{
|
||||||
|
search.FullyAvailable = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,6 +96,9 @@ namespace Ombi.Controllers
|
||||||
return new UnauthorizedResult();
|
return new UnauthorizedResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the Token for the Ombi User if we can match the Plex user with a valid Ombi User
|
||||||
|
/// </summary>
|
||||||
[HttpPost("plextoken")]
|
[HttpPost("plextoken")]
|
||||||
public async Task<IActionResult> GetTokenWithPlexToken([FromBody] PlexTokenAuthentication model)
|
public async Task<IActionResult> GetTokenWithPlexToken([FromBody] PlexTokenAuthentication model)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue