mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-30 19:40:05 -07:00
Fixed the issue where episodes were not being marked as available in the search #2367
This commit is contained in:
parent
5eaa5cf78c
commit
f339969258
1 changed files with 16 additions and 5 deletions
|
@ -1,4 +1,6 @@
|
||||||
using System.Linq;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Linq.Expressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Ombi.Core.Models.Search;
|
using Ombi.Core.Models.Search;
|
||||||
|
@ -59,10 +61,19 @@ namespace Ombi.Core.Rule.Rules.Search
|
||||||
{
|
{
|
||||||
EmbyEpisode epExists = null;
|
EmbyEpisode epExists = null;
|
||||||
|
|
||||||
epExists = await allEpisodes.FirstOrDefaultAsync(x =>
|
if (item.HasImdb)
|
||||||
x.EpisodeNumber == episode.EpisodeNumber && x.SeasonNumber == season.SeasonNumber &&
|
{
|
||||||
x.Series.ProviderId == item.ProviderId.ToString());
|
epExists = await allEpisodes.FirstOrDefaultAsync(e => e.EpisodeNumber == episode.EpisodeNumber && e.SeasonNumber == season.SeasonNumber
|
||||||
|
&& e.ImdbId == item.ImdbId);
|
||||||
|
} if (item.HasTvDb)
|
||||||
|
{
|
||||||
|
epExists = await allEpisodes.FirstOrDefaultAsync(e => e.EpisodeNumber == episode.EpisodeNumber && e.SeasonNumber == season.SeasonNumber
|
||||||
|
&& e.TvDbId == item.TvDbId);
|
||||||
|
} if (item.HasTheMovieDb)
|
||||||
|
{
|
||||||
|
epExists = await allEpisodes.FirstOrDefaultAsync(e => e.EpisodeNumber == episode.EpisodeNumber && e.SeasonNumber == season.SeasonNumber
|
||||||
|
&& e.TheMovieDbId == item.TheMovieDbId);
|
||||||
|
}
|
||||||
|
|
||||||
if (epExists != null)
|
if (epExists != null)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue