diff --git a/src/Ombi/ClientApp/app/requests/tvrequests.component.html b/src/Ombi/ClientApp/app/requests/tvrequests.component.html index e5161c8c5..e515ee47a 100644 --- a/src/Ombi/ClientApp/app/requests/tvrequests.component.html +++ b/src/Ombi/ClientApp/app/requests/tvrequests.component.html @@ -4,12 +4,20 @@
+ + + (scrolled)="loadMore()">--> +
+ +
@@ -83,9 +77,5 @@
- - - -
diff --git a/src/Ombi/ClientApp/app/search/seriesinformation.component.ts b/src/Ombi/ClientApp/app/search/seriesinformation.component.ts index 79c2b0128..ad705ecfc 100644 --- a/src/Ombi/ClientApp/app/search/seriesinformation.component.ts +++ b/src/Ombi/ClientApp/app/search/seriesinformation.component.ts @@ -1,5 +1,5 @@ -import { Component, OnInit, OnDestroy } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; +import { Component, OnInit, OnDestroy, Input} from '@angular/core'; +//import { ActivatedRoute } from '@angular/router'; import { Subject } from 'rxjs/Subject'; import "rxjs/add/operator/takeUntil"; @@ -13,24 +13,19 @@ import { IRequestEngineResult } from '../interfaces/IRequestEngineResult'; import { IEpisodesRequests } from "../interfaces/IRequestModel"; @Component({ + selector: 'seriesinformation', templateUrl: './seriesinformation.component.html', styleUrls: ['./seriesinformation.component.scss'] }) export class SeriesInformationComponent implements OnInit, OnDestroy { - constructor(private searchService: SearchService, private route: ActivatedRoute, - private requestService: RequestService, private notificationService: NotificationService) { - this.route.params - .takeUntil(this.subscriptions) - .subscribe(params => { - this.seriesId = +params['id']; // (+) converts string 'id' to a number - }); + constructor(private searchService: SearchService, private requestService: RequestService, private notificationService: NotificationService) { } private subscriptions = new Subject(); public result : IRequestEngineResult; - private seriesId: number; + @Input() private seriesId: number; public series: ISearchTvResult; requestedEpisodes: IEpisodesRequests[] = []; diff --git a/src/Ombi/ClientApp/app/search/tvsearch.component.html b/src/Ombi/ClientApp/app/search/tvsearch.component.html index b5c727764..5120fee8b 100644 --- a/src/Ombi/ClientApp/app/search/tvsearch.component.html +++ b/src/Ombi/ClientApp/app/search/tvsearch.component.html @@ -32,123 +32,133 @@
Sorry, we didn't find any results!
+ + + + Results + + + +
+
+
-
-
-
+ poster - poster +
+
+
-
-
-
+ +

{{node.data.title}} ({{node.data.firstAired | date: 'yyyy'}})

-
-

{{result.title}} ({{result.firstAired | date: 'yyyy'}})

- -
- - {{result.status}} + + {{node.data.status}} - Air Date: {{result.firstAired}} + Air Date: {{node.data.firstAired}} - Release Date: {{result.releaseDate | date: 'dd/MM/yyyy'}} + Release Date: {{node.data.releaseDate | date: 'dd/MM/yyyy'}} - Available - Processing Request -
- - Pending Approval - + Available + Processing Request +
+ + Pending Approval + - - Not Yet Requested - + + Not Yet Requested + - + - HomePage + HomePage - Trailer + Trailer -
-
+
+
+
+

{{node.data.overview}}

+
+ + +
+ + + + + + + + + + +
+
+ View On Plex + + +
+ +
+ +
+
-

{{result.overview}}

-
- - -
- - - - - - - - -
-
-
- + + +
\ No newline at end of file diff --git a/src/Ombi/ClientApp/app/search/tvsearch.component.ts b/src/Ombi/ClientApp/app/search/tvsearch.component.ts index f1c2cfa68..bbfd1bf66 100644 --- a/src/Ombi/ClientApp/app/search/tvsearch.component.ts +++ b/src/Ombi/ClientApp/app/search/tvsearch.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, OnDestroy } from '@angular/core'; +import { Component, OnInit, OnDestroy, ViewEncapsulation } from '@angular/core'; import {Router} from '@angular/router'; import { Subject } from 'rxjs/Subject'; import 'rxjs/add/operator/debounceTime'; @@ -12,10 +12,16 @@ import { NotificationService } from '../services/notification.service'; import { ISearchTvResult } from '../interfaces/ISearchTvResult'; import { IRequestEngineResult } from '../interfaces/IRequestEngineResult'; +import { TreeNode } from "primeng/primeng"; @Component({ selector: 'tv-search', templateUrl: './tvsearch.component.html', + styleUrls: ['./../requests/tvrequests.component.scss'], + //Was required to turn off encapsulation since CSS only should be overridden for this component + //However when encapsulation is on angular injects prefixes to all classes so css selectors + //Stop working + encapsulation: ViewEncapsulation.None }) export class TvSearchComponent implements OnInit, OnDestroy { @@ -41,11 +47,50 @@ export class TvSearchComponent implements OnInit, OnDestroy { this.searchService.searchTv(this.searchText) .takeUntil(this.subscriptions) .subscribe(x => { - this.tvResults = x; + this.tvResults = this.transformData(x); this.searchApplied = true; }); }); } + openClosestTab(el: any): void { + var rowclass = "undefined"; + el = el.toElement; + while (el.className != rowclass) { + // Increment the loop to the parent node until we find the row we need + el = el.parentNode; + if (!el) { + } + } + // At this point, the while loop has stopped and `el` represents the element that has + // the class you specified + + // Then we loop through the children to find the caret which we want to click + var caretright = "ui-treetable-toggler fa fa-fw ui-c fa-caret-right"; + var caretdown = "ui-treetable-toggler fa fa-fw ui-c fa-caret-down"; + for (var value of el.children) { + // the caret from the ui has 2 class selectors depending on if expanded or not + // we search for both since we want to still toggle the clicking + if (value.className === caretright || value.className === caretdown) { + // Then we tell JS to click the element even though we hid it from the UI + value.click(); + //Break from loop since we no longer need to continue looking + break; + } + }; + } + transformData(datain: ISearchTvResult[]): any { + var temp: TreeNode[] = []; + datain.forEach(function (value) { + temp.push({ + "data": value, + "children": [{ + "data": value, leaf: true + }], + leaf: false + }); + }, this) + return temp; + } ngOnInit(): void { this.searchText = "";