From af2f8d1380d977eaa6a6470167a33f6cbacbdb1d Mon Sep 17 00:00:00 2001 From: "Jamie.Rees" Date: Fri, 29 Sep 2017 15:44:46 +0100 Subject: [PATCH] Fixed a bug where we were marking the wrong episodes as available #1513 #865 --- src/Ombi.Core/Engine/TvSearchEngine.cs | 2 +- src/Ombi/ClientApp/app/app.component.ts | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Ombi.Core/Engine/TvSearchEngine.cs b/src/Ombi.Core/Engine/TvSearchEngine.cs index 44559cbf6..83ba0843d 100644 --- a/src/Ombi.Core/Engine/TvSearchEngine.cs +++ b/src/Ombi.Core/Engine/TvSearchEngine.cs @@ -232,7 +232,7 @@ namespace Ombi.Core.Engine foreach (var episode in season.Episodes) { var epExists = await allEpisodes.FirstOrDefaultAsync(x => - x.EpisodeNumber == episode.EpisodeNumber && x.SeasonNumber == season.SeasonNumber); + x.EpisodeNumber == episode.EpisodeNumber && x.SeasonNumber == season.SeasonNumber && x.Series.ProviderId == item.Id.ToString()); if (epExists != null) { episode.Available = true; diff --git a/src/Ombi/ClientApp/app/app.component.ts b/src/Ombi/ClientApp/app/app.component.ts index 3ff460330..c7c7c4412 100644 --- a/src/Ombi/ClientApp/app/app.component.ts +++ b/src/Ombi/ClientApp/app/app.component.ts @@ -33,11 +33,13 @@ export class AppComponent implements OnInit { this.router.events.subscribe(() => { this.user = this.authService.claims(); this.showNav = this.authService.loggedIn(); - }); - if (this.user !== null && this.user.name) { - this.jobService.getCachedUpdate().subscribe(x => this.updateAvailable = x); - } + if (this.user !== null && this.user.name) { + this.jobService.getCachedUpdate().subscribe(x => { + this.updateAvailable = (x === true); + }); + } + }); } public hasRole(role: string): boolean {