From 6cef4f4cc43869acdda3cac66966245d60811405 Mon Sep 17 00:00:00 2001 From: Jamie Rees Date: Sat, 16 May 2020 21:33:20 +0100 Subject: [PATCH] linked up the tv to issues --- src/Ombi.Core/Engine/V2/TvSearchEngineV2.cs | 4 ++-- src/Ombi/ClientApp/src/app/issues/issuestable.component.html | 4 ++-- .../shared/issues-panel/issues-panel.component.html | 2 +- .../app/media-details/components/tv/tv-details.component.ts | 5 +++++ .../ClientApp/src/app/media-details/media-details.module.ts | 1 + src/Ombi/ClientApp/src/app/services/searchV2.service.ts | 4 ++++ 6 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/Ombi.Core/Engine/V2/TvSearchEngineV2.cs b/src/Ombi.Core/Engine/V2/TvSearchEngineV2.cs index 5af022a8d..2f046f490 100644 --- a/src/Ombi.Core/Engine/V2/TvSearchEngineV2.cs +++ b/src/Ombi.Core/Engine/V2/TvSearchEngineV2.cs @@ -51,8 +51,8 @@ namespace Ombi.Core.Engine.V2 public async Task GetShowByRequest(int requestId) { - var request = await RequestService.TvRequestService.GetChild().Include(x => x.ParentRequest).FirstOrDefaultAsync(x => x.Id == requestId); - return await GetShowInformation(request.ParentRequest.TvDbId); + var request = await RequestService.TvRequestService.Get().FirstOrDefaultAsync(x => x.Id == requestId); + return await GetShowInformation(request.TvDbId); } public async Task GetShowInformation(int tvdbid) diff --git a/src/Ombi/ClientApp/src/app/issues/issuestable.component.html b/src/Ombi/ClientApp/src/app/issues/issuestable.component.html index d48b267e3..9dd885cf9 100644 --- a/src/Ombi/ClientApp/src/app/issues/issuestable.component.html +++ b/src/Ombi/ClientApp/src/app/issues/issuestable.component.html @@ -52,8 +52,8 @@ - - + + diff --git a/src/Ombi/ClientApp/src/app/media-details/components/shared/issues-panel/issues-panel.component.html b/src/Ombi/ClientApp/src/app/media-details/components/shared/issues-panel/issues-panel.component.html index e7d54765d..c4c05dff9 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/shared/issues-panel/issues-panel.component.html +++ b/src/Ombi/ClientApp/src/app/media-details/components/shared/issues-panel/issues-panel.component.html @@ -38,7 +38,7 @@ {{'Issues.ResolvedDate' | translate}}: {{issue.resolvedDate}}
- {{'Issues.CreatedDate' | translate}}: {{issue.createdDate}} + {{'Issues.CreatedDate' | translate}}: {{issue.createdDate | date}}
diff --git a/src/Ombi/ClientApp/src/app/media-details/components/tv/tv-details.component.ts b/src/Ombi/ClientApp/src/app/media-details/components/tv/tv-details.component.ts index f48ee36e6..b59cf6b8e 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/tv/tv-details.component.ts +++ b/src/Ombi/ClientApp/src/app/media-details/components/tv/tv-details.component.ts @@ -23,6 +23,7 @@ export class TvDetailsComponent implements OnInit { public isAdmin: boolean; private tvdbId: number; + private requestIdFromQuery: number; constructor(private searchService: SearchV2Service, private route: ActivatedRoute, private sanitizer: DomSanitizer, private imageService: ImageService, @@ -31,6 +32,7 @@ export class TvDetailsComponent implements OnInit { this.route.params.subscribe((params: any) => { this.tvdbId = params.tvdbId; this.fromSearch = params.search; + this.requestIdFromQuery = +params.requestId; // Coming from the issues page }); } @@ -44,6 +46,9 @@ export class TvDetailsComponent implements OnInit { if (this.fromSearch) { this.tv = await this.searchService.getTvInfoWithMovieDbId(this.tvdbId); this.tvdbId = this.tv.id; + } else if (this.requestIdFromQuery) { + console.log("REQUESTID" + this.requestIdFromQuery) + this.tv = await this.searchService.getTvInfoWithRequestId(this.requestIdFromQuery); } else { this.tv = await this.searchService.getTvInfo(this.tvdbId); } diff --git a/src/Ombi/ClientApp/src/app/media-details/media-details.module.ts b/src/Ombi/ClientApp/src/app/media-details/media-details.module.ts index e494319c4..5c210fddb 100644 --- a/src/Ombi/ClientApp/src/app/media-details/media-details.module.ts +++ b/src/Ombi/ClientApp/src/app/media-details/media-details.module.ts @@ -21,6 +21,7 @@ const routes: Routes = [ { path: "movie/request/:requestId", component: MovieDetailsComponent, canActivate: [AuthGuard] }, { path: "tv/:tvdbId/:search", component: TvDetailsComponent, canActivate: [AuthGuard] }, { path: "tv/:tvdbId", component: TvDetailsComponent, canActivate: [AuthGuard] }, + { path: "show/request/:requestId", component: TvDetailsComponent, canActivate: [AuthGuard] }, { path: "artist/:artistId", component: ArtistDetailsComponent, canActivate: [AuthGuard] }, ]; @NgModule({ diff --git a/src/Ombi/ClientApp/src/app/services/searchV2.service.ts b/src/Ombi/ClientApp/src/app/services/searchV2.service.ts index 2b8fda367..411620713 100644 --- a/src/Ombi/ClientApp/src/app/services/searchV2.service.ts +++ b/src/Ombi/ClientApp/src/app/services/searchV2.service.ts @@ -92,6 +92,10 @@ export class SearchV2Service extends ServiceHelpers { public getTvInfo(tvdbid: number): Promise { return this.http.get(`${this.url}/Tv/${tvdbid}`, { headers: this.headers }).toPromise(); } + + public getTvInfoWithRequestId(requestId: number): Promise { + return this.http.get(`${this.url}/Tv/request/${requestId}`, { headers: this.headers }).toPromise(); + } public getTvInfoWithMovieDbId(theMovieDbId: number): Promise { return this.http.get(`${this.url}/Tv/moviedb/${theMovieDbId}`, { headers: this.headers }).toPromise();